gm-copilot-cli 2.0.524 → 2.0.525
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/copilot-profile.md +1 -1
- package/index.html +481 -5
- package/manifest.yml +1 -1
- package/package.json +1 -1
- package/tools.json +1 -1
package/copilot-profile.md
CHANGED
package/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Copilot CLI - gm plugin</title>
|
|
7
|
-
<
|
|
8
|
-
|
|
7
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
8
|
+
|
|
9
9
|
<style>
|
|
10
10
|
body{background:#0f172a;color:#e2e8f0;font-family:system-ui,sans-serif;margin:0}
|
|
11
11
|
.gradient-hero{background:linear-gradient(135deg,#0f172a 0%,#1e1b4b 50%,#0f172a 100%)}
|
|
@@ -15,10 +15,486 @@
|
|
|
15
15
|
</style>
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
|
-
<script
|
|
19
|
-
|
|
18
|
+
<script>
|
|
19
|
+
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
20
|
+
const MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
|
21
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
22
|
+
|
|
23
|
+
const Fragment = (props) => {
|
|
24
|
+
return props.children
|
|
25
|
+
? Array.isArray(props.children)
|
|
26
|
+
? props.children
|
|
27
|
+
: [props.children]
|
|
28
|
+
: [];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Handles event listener updates for an element
|
|
33
|
+
*/
|
|
34
|
+
function updateEventListener(el, eventName, newHandler, oldHandler) {
|
|
35
|
+
if (oldHandler && oldHandler !== newHandler) {
|
|
36
|
+
el.removeEventListener(eventName, oldHandler);
|
|
37
|
+
}
|
|
38
|
+
if (newHandler && oldHandler !== newHandler) {
|
|
39
|
+
el.addEventListener(eventName, newHandler);
|
|
40
|
+
el.__webjsx_listeners = {
|
|
41
|
+
...(el.__webjsx_listeners || {}),
|
|
42
|
+
[eventName]: newHandler,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Updates a single property or attribute on an element
|
|
48
|
+
*/
|
|
49
|
+
function updatePropOrAttr(el, key, value) {
|
|
50
|
+
if (el instanceof HTMLElement) {
|
|
51
|
+
if (key in el) {
|
|
52
|
+
// Fast path: property exists on HTMLElement
|
|
53
|
+
el[key] = value;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (typeof value === "string") {
|
|
57
|
+
el.setAttribute(key, value);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// Fallback for non-string values on HTMLElement
|
|
61
|
+
el[key] = value;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// SVG/Other namespace elements
|
|
65
|
+
const isSVG = el.namespaceURI === "http://www.w3.org/2000/svg";
|
|
66
|
+
if (isSVG) {
|
|
67
|
+
if (value != null) {
|
|
68
|
+
el.setAttribute(key, value.toString());
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
el.removeAttribute(key);
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Fallback for other element types
|
|
76
|
+
if (typeof value === "string") {
|
|
77
|
+
el.setAttribute(key, value);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
el[key] = value;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Handles suspension of rendering during updates
|
|
85
|
+
*/
|
|
86
|
+
function withRenderSuspension(el, callback) {
|
|
87
|
+
const isRenderingSuspended = !!el
|
|
88
|
+
.__webjsx_suspendRendering;
|
|
89
|
+
if (isRenderingSuspended) {
|
|
90
|
+
el.__webjsx_suspendRendering();
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
return callback();
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
if (isRenderingSuspended) {
|
|
97
|
+
el.__webjsx_resumeRendering();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Core function to update attributes and properties on a DOM element
|
|
103
|
+
*/
|
|
104
|
+
function updateAttributesCore(el, newProps, oldProps = {}) {
|
|
105
|
+
// Handle new/updated props
|
|
106
|
+
for (const [key, value] of Object.entries(newProps)) {
|
|
107
|
+
if (key === "children" ||
|
|
108
|
+
key === "key" ||
|
|
109
|
+
key === "dangerouslySetInnerHTML")
|
|
110
|
+
continue;
|
|
111
|
+
if (key.startsWith("on") && typeof value === "function") {
|
|
112
|
+
const eventName = key.substring(2).toLowerCase();
|
|
113
|
+
updateEventListener(el, eventName, value, el.__webjsx_listeners?.[eventName]);
|
|
114
|
+
}
|
|
115
|
+
else if (value !== oldProps[key]) {
|
|
116
|
+
updatePropOrAttr(el, key, value);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Handle dangerouslySetInnerHTML
|
|
120
|
+
if ("dangerouslySetInnerHTML" in newProps) {
|
|
121
|
+
const html = newProps.dangerouslySetInnerHTML.__html || "";
|
|
122
|
+
el.innerHTML = html;
|
|
123
|
+
}
|
|
124
|
+
else if ("dangerouslySetInnerHTML" in oldProps) {
|
|
125
|
+
el.innerHTML = "";
|
|
126
|
+
}
|
|
127
|
+
// If this is a fresh set (no oldProps), remove any attributes not in newProps
|
|
128
|
+
if (Object.keys(oldProps).length === 0) {
|
|
129
|
+
const currentAttrs = Array.from(el.attributes).map((attr) => attr.name);
|
|
130
|
+
for (const attr of currentAttrs) {
|
|
131
|
+
if (!(attr in newProps) && !attr.startsWith("on")) {
|
|
132
|
+
el.removeAttribute(attr);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// Remove old props/attributes
|
|
137
|
+
for (const key of Object.keys(oldProps)) {
|
|
138
|
+
if (!(key in newProps) &&
|
|
139
|
+
key !== "children" &&
|
|
140
|
+
key !== "key" &&
|
|
141
|
+
key !== "dangerouslySetInnerHTML") {
|
|
142
|
+
if (key.startsWith("on")) {
|
|
143
|
+
const eventName = key.substring(2).toLowerCase();
|
|
144
|
+
const existingListener = el.__webjsx_listeners?.[eventName];
|
|
145
|
+
if (existingListener) {
|
|
146
|
+
el.removeEventListener(eventName, existingListener);
|
|
147
|
+
delete el.__webjsx_listeners[eventName];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else if (key in el) {
|
|
151
|
+
el[key] = undefined;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
el.removeAttribute(key);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Store current props for future updates
|
|
159
|
+
el.__webjsx_props = newProps;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Sets attributes and properties on a DOM element based on the provided props.
|
|
163
|
+
* If the property exists on the element, it sets it as a property.
|
|
164
|
+
* Otherwise, it sets it as an attribute or property based on the value type.
|
|
165
|
+
*
|
|
166
|
+
* @param el - The DOM element to update.
|
|
167
|
+
* @param props - The new properties to apply.
|
|
168
|
+
*/
|
|
169
|
+
function setAttributes(el, props) {
|
|
170
|
+
withRenderSuspension(el, () => {
|
|
171
|
+
updateAttributesCore(el, props);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Updates attributes and properties on a DOM element based on the new and old props.
|
|
176
|
+
*
|
|
177
|
+
* @param el - The DOM element to update.
|
|
178
|
+
* @param newProps - The new properties to apply.
|
|
179
|
+
* @param oldProps - The old properties to compare against.
|
|
180
|
+
*/
|
|
181
|
+
function updateAttributes(el, newProps, oldProps) {
|
|
182
|
+
withRenderSuspension(el, () => {
|
|
183
|
+
updateAttributesCore(el, newProps, oldProps);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function isFragment(type) {
|
|
188
|
+
return type === Fragment;
|
|
189
|
+
}
|
|
190
|
+
function createNode(vnode, parentNamespaceURI) {
|
|
191
|
+
if (typeof vnode === "string" ||
|
|
192
|
+
typeof vnode === "number" ||
|
|
193
|
+
typeof vnode === "boolean") {
|
|
194
|
+
return document.createTextNode(String(vnode));
|
|
195
|
+
}
|
|
196
|
+
else if (isFragment(vnode.type)) {
|
|
197
|
+
const fragment = document.createDocumentFragment();
|
|
198
|
+
if (vnode.props.children) {
|
|
199
|
+
const children = vnode.props.children;
|
|
200
|
+
children.forEach((child) => {
|
|
201
|
+
fragment.appendChild(createNode(child, undefined));
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return fragment;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
const namespaceURI = vnode.props.xmlns !== undefined
|
|
208
|
+
? vnode.props.xmlns
|
|
209
|
+
: vnode.type === "svg"
|
|
210
|
+
? SVG_NAMESPACE
|
|
211
|
+
: parentNamespaceURI ?? undefined;
|
|
212
|
+
const el = vnode.props.is !== undefined
|
|
213
|
+
? namespaceURI !== undefined
|
|
214
|
+
? document.createElementNS(namespaceURI, vnode.type, {
|
|
215
|
+
is: vnode.props.is,
|
|
216
|
+
})
|
|
217
|
+
: document.createElement(vnode.type, {
|
|
218
|
+
is: vnode.props.is,
|
|
219
|
+
})
|
|
220
|
+
: namespaceURI !== undefined
|
|
221
|
+
? document.createElementNS(namespaceURI, vnode.type)
|
|
222
|
+
: document.createElement(vnode.type);
|
|
223
|
+
if (vnode.props) {
|
|
224
|
+
setAttributes(el, vnode.props);
|
|
225
|
+
}
|
|
226
|
+
if (vnode.props.key != null) {
|
|
227
|
+
el.__webjsx_key = vnode.props.key;
|
|
228
|
+
el.setAttribute("data-key", String(vnode.props.key));
|
|
229
|
+
}
|
|
230
|
+
if (vnode.props.ref) {
|
|
231
|
+
assignRef(el, vnode.props.ref);
|
|
232
|
+
}
|
|
233
|
+
if (vnode.props.children && !vnode.props.dangerouslySetInnerHTML) {
|
|
234
|
+
const children = vnode.props.children;
|
|
235
|
+
children.forEach((child) => {
|
|
236
|
+
el.appendChild(createNode(child, namespaceURI));
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
return el;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Assigns a ref to a node.
|
|
244
|
+
* @param node The DOM node.
|
|
245
|
+
* @param ref The ref to assign.
|
|
246
|
+
*/
|
|
247
|
+
function assignRef(node, ref) {
|
|
248
|
+
const currentRef = node.__webjsx_assignedRef;
|
|
249
|
+
// Only assign the ref if it's different
|
|
250
|
+
if (currentRef !== ref) {
|
|
251
|
+
if (typeof ref === "function") {
|
|
252
|
+
ref(node);
|
|
253
|
+
}
|
|
254
|
+
else if (ref && typeof ref === "object") {
|
|
255
|
+
ref.current = node;
|
|
256
|
+
}
|
|
257
|
+
// Store the assigned ref
|
|
258
|
+
node.__webjsx_assignedRef = ref;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function createElement(type, props, ...children) {
|
|
263
|
+
const normalizedProps = props ? { ...props } : {};
|
|
264
|
+
const flatChildren = [];
|
|
265
|
+
const flatten = (child) => {
|
|
266
|
+
if (Array.isArray(child)) {
|
|
267
|
+
child.forEach(flatten);
|
|
268
|
+
}
|
|
269
|
+
else if (typeof child === "string" || typeof child === "number") {
|
|
270
|
+
flatChildren.push(child);
|
|
271
|
+
}
|
|
272
|
+
else if (child === null ||
|
|
273
|
+
child === undefined ||
|
|
274
|
+
typeof child === "boolean") {
|
|
275
|
+
// Ignore null or undefined children
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
flatChildren.push(child);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
children.forEach(flatten);
|
|
282
|
+
if (flatChildren.length > 0) {
|
|
283
|
+
// Only set children if dangerouslySetInnerHTML is not present
|
|
284
|
+
if (!normalizedProps.dangerouslySetInnerHTML) {
|
|
285
|
+
normalizedProps.children = flatChildren;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
console.warn("WebJSX: Ignoring children since dangerouslySetInnerHTML is set.");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
type,
|
|
293
|
+
props: normalizedProps,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Applies the differences between the new virtual node(s) and the existing DOM.
|
|
299
|
+
* @param parent The parent DOM node where the virtual nodes will be applied.
|
|
300
|
+
* @param newVirtualNode A single virtual node or an array of virtual nodes.
|
|
301
|
+
*/
|
|
302
|
+
function applyDiff(parent, newVirtualNode) {
|
|
303
|
+
const newVNodes = Array.isArray(newVirtualNode)
|
|
304
|
+
? newVirtualNode
|
|
305
|
+
: [newVirtualNode];
|
|
306
|
+
diffChildren(parent, newVNodes);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Flattens the list of virtual nodes by replacing Fragments with their children.
|
|
310
|
+
* @param vnodes The array of virtual nodes to flatten.
|
|
311
|
+
* @returns A new array of virtual nodes with Fragments flattened.
|
|
312
|
+
*/
|
|
313
|
+
function flattenVNodes(vnodes) {
|
|
314
|
+
const flat = [];
|
|
315
|
+
const arrayVNodes = vnodes;
|
|
316
|
+
arrayVNodes.forEach((vnode) => {
|
|
317
|
+
if (isFragment(vnode)) {
|
|
318
|
+
const children = vnode.props.children ? vnode.props.children : [];
|
|
319
|
+
flat.push(...children);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
flat.push(vnode);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
return flat;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Type guard to check if a VNode is a Fragment.
|
|
329
|
+
* @param vnode The virtual node to check.
|
|
330
|
+
* @returns True if vnode is a Fragment, false otherwise.
|
|
331
|
+
*/
|
|
332
|
+
function isFragment(vnode) {
|
|
333
|
+
return typeof vnode === "object" && vnode !== null && vnode.type === Fragment;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Diffs and updates the children of a DOM node based on the new virtual nodes.
|
|
337
|
+
* @param parent The parent DOM node whose children will be diffed.
|
|
338
|
+
* @param newVNodes An array of new virtual nodes.
|
|
339
|
+
*/
|
|
340
|
+
function diffChildren(parent, newVNodes) {
|
|
341
|
+
const flattenedVNodes = flattenVNodes(newVNodes);
|
|
342
|
+
const existingNodes = Array.from(parent.childNodes);
|
|
343
|
+
const keyedMap = new Map();
|
|
344
|
+
// Populate keyedMap with existing keyed nodes
|
|
345
|
+
existingNodes.forEach((node) => {
|
|
346
|
+
const key = node.__webjsx_key;
|
|
347
|
+
if (key != null) {
|
|
348
|
+
keyedMap.set(key, node);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
const newKeys = flattenedVNodes
|
|
352
|
+
.filter(isVElementWithKey)
|
|
353
|
+
.map((vnode) => vnode.props.key);
|
|
354
|
+
existingNodes.forEach((node) => {
|
|
355
|
+
const key = node.__webjsx_key;
|
|
356
|
+
if (key != null && !newKeys.includes(key)) {
|
|
357
|
+
parent.removeChild(node);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
flattenedVNodes.forEach((newVNode, i) => {
|
|
361
|
+
const newKey = isVElement(newVNode) ? newVNode.props.key : undefined;
|
|
362
|
+
let existingNode = null;
|
|
363
|
+
if (newKey != null) {
|
|
364
|
+
existingNode = keyedMap.get(newKey) || null;
|
|
365
|
+
}
|
|
366
|
+
if (!existingNode && newKey == null) {
|
|
367
|
+
existingNode = parent.childNodes[i] || null;
|
|
368
|
+
}
|
|
369
|
+
if (existingNode) {
|
|
370
|
+
if (existingNode !== parent.childNodes[i]) {
|
|
371
|
+
parent.insertBefore(existingNode, parent.childNodes[i] || null);
|
|
372
|
+
}
|
|
373
|
+
updateNode(existingNode, newVNode);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
const newDomNode = createNode(newVNode, getNamespaceURI(parent));
|
|
377
|
+
if (isVElement(newVNode) && newVNode.props.key != null) {
|
|
378
|
+
newDomNode.__webjsx_key = newVNode.props.key;
|
|
379
|
+
newDomNode.setAttribute("data-key", String(newVNode.props.key));
|
|
380
|
+
}
|
|
381
|
+
parent.insertBefore(newDomNode, parent.childNodes[i] || null);
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
const updatedChildNodes = Array.from(parent.childNodes);
|
|
385
|
+
const newUnkeyed = flattenedVNodes.filter((vnode) => !isVElementWithKey(vnode));
|
|
386
|
+
const existingUnkeyed = updatedChildNodes.filter((node) => !node.__webjsx_key);
|
|
387
|
+
if (newUnkeyed.length < existingUnkeyed.length) {
|
|
388
|
+
for (let i = newUnkeyed.length; i < existingUnkeyed.length; i++) {
|
|
389
|
+
parent.removeChild(existingUnkeyed[i]);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Updates a DOM node to match the new virtual node.
|
|
395
|
+
* @param domNode The existing DOM node to be updated.
|
|
396
|
+
* @param newVNode The new virtual node to apply.
|
|
397
|
+
*/
|
|
398
|
+
function updateNode(domNode, newVNode) {
|
|
399
|
+
if (typeof newVNode === "string" ||
|
|
400
|
+
typeof newVNode === "number" ||
|
|
401
|
+
typeof newVNode === "boolean") {
|
|
402
|
+
if (domNode.nodeType !== Node.TEXT_NODE ||
|
|
403
|
+
domNode.textContent !== String(newVNode)) {
|
|
404
|
+
const newTextNode = document.createTextNode(String(newVNode));
|
|
405
|
+
domNode.parentNode?.replaceChild(newTextNode, domNode);
|
|
406
|
+
}
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (newVNode.type === Fragment) {
|
|
410
|
+
if (domNode instanceof DocumentFragment) {
|
|
411
|
+
diffChildren(domNode, newVNode.props.children ? newVNode.props.children : []);
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
const fragment = document.createDocumentFragment();
|
|
415
|
+
const children = newVNode.props.children ? newVNode.props.children : [];
|
|
416
|
+
children.forEach((child) => {
|
|
417
|
+
fragment.appendChild(createNode(child, undefined));
|
|
418
|
+
});
|
|
419
|
+
domNode.parentNode?.replaceChild(fragment, domNode);
|
|
420
|
+
}
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
if (domNode instanceof HTMLElement &&
|
|
424
|
+
domNode.tagName.toLowerCase() === newVNode.type.toLowerCase()) {
|
|
425
|
+
const oldProps = domNode.__webjsx_props || {};
|
|
426
|
+
const newProps = newVNode.props || {};
|
|
427
|
+
updateAttributes(domNode, newProps, oldProps);
|
|
428
|
+
if (isVElement(newVNode) && newVNode.props.key != null) {
|
|
429
|
+
domNode.__webjsx_key = newVNode.props.key;
|
|
430
|
+
domNode.setAttribute("data-key", String(newVNode.props.key));
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
delete domNode.__webjsx_key;
|
|
434
|
+
domNode.removeAttribute("data-key");
|
|
435
|
+
}
|
|
436
|
+
if (newProps.ref) {
|
|
437
|
+
assignRef(domNode, newProps.ref);
|
|
438
|
+
}
|
|
439
|
+
if (!newProps.dangerouslySetInnerHTML && newProps.children != null) {
|
|
440
|
+
diffChildren(domNode, newProps.children);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
const newDomNode = createNode(newVNode, domNode.parentNode ? getNamespaceURI(domNode.parentNode) : undefined);
|
|
445
|
+
if (isVElement(newVNode) && newVNode.props.key != null) {
|
|
446
|
+
newDomNode.__webjsx_key = newVNode.props.key;
|
|
447
|
+
newDomNode.setAttribute("data-key", String(newVNode.props.key));
|
|
448
|
+
}
|
|
449
|
+
if (isVElement(newVNode) && newVNode.props.ref) {
|
|
450
|
+
assignRef(newDomNode, newVNode.props.ref);
|
|
451
|
+
}
|
|
452
|
+
domNode.parentNode?.replaceChild(newDomNode, domNode);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Assigns a ref to a node.
|
|
457
|
+
* @param node The DOM node.
|
|
458
|
+
* @param ref The ref to assign.
|
|
459
|
+
*/
|
|
460
|
+
function assignRef(node, ref) {
|
|
461
|
+
const currentRef = node.__webjsx_assignedRef;
|
|
462
|
+
// Only assign the ref if it's different
|
|
463
|
+
if (currentRef !== ref) {
|
|
464
|
+
if (typeof ref === "function") {
|
|
465
|
+
ref(node);
|
|
466
|
+
}
|
|
467
|
+
else if (ref && typeof ref === "object") {
|
|
468
|
+
ref.current = node;
|
|
469
|
+
}
|
|
470
|
+
// Store the assigned ref
|
|
471
|
+
node.__webjsx_assignedRef = ref;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Type guard to check if a VNode is a VElement.
|
|
476
|
+
* @param vnode The virtual node to check.
|
|
477
|
+
* @returns True if vnode is a VElement, false otherwise.
|
|
478
|
+
*/
|
|
479
|
+
function isVElement(vnode) {
|
|
480
|
+
return typeof vnode === "object" && vnode !== null && "props" in vnode;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Type guard to check if a VNode is a VElement with a key.
|
|
484
|
+
* @param vnode The virtual node to check.
|
|
485
|
+
* @returns True if vnode is a VElement with a key, false otherwise.
|
|
486
|
+
*/
|
|
487
|
+
function isVElementWithKey(vnode) {
|
|
488
|
+
return isVElement(vnode) && vnode.props.key != null;
|
|
489
|
+
}
|
|
490
|
+
function getNamespaceURI(node) {
|
|
491
|
+
return node instanceof Element && node.namespaceURI !== HTML_NAMESPACE
|
|
492
|
+
? node.namespaceURI ?? undefined
|
|
493
|
+
: undefined;
|
|
494
|
+
}
|
|
495
|
+
|
|
20
496
|
const PLATFORM_NAME="Copilot CLI",PLATFORM_TYPE="CLI Tool",PLATFORM_TYPE_COLOR="#3b82f6";
|
|
21
|
-
const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.
|
|
497
|
+
const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.525";
|
|
22
498
|
const GITHUB_URL="https://github.com/AnEntrypoint/gm-copilot-cli",BADGE_LABEL="copilot-cli";
|
|
23
499
|
const FEATURES=[{"title":"State Machine","desc":"Immutable PLAN→EXECUTE→EMIT→VERIFY→COMPLETE phases with full mutable tracking"},{"title":"Semantic Search","desc":"Natural language codebase exploration via codesearch skill — no grep needed"},{"title":"Hooks","desc":"Pre-tool, session-start, prompt-submit, and stop hooks for full lifecycle control"},{"title":"Agents","desc":"gm, codesearch, and websearch agents pre-configured and ready to use"},{"title":"MCP Integration","desc":"Model Context Protocol server support built in"},{"title":"Auto-Recovery","desc":"Supervisor hierarchy ensures the system never crashes"}],INSTALL_STEPS=[{"desc":"Install via GitHub CLI","cmd":"gh extension install AnEntrypoint/gm-copilot-cli"},{"desc":"Restart your terminal — activates automatically"}];
|
|
24
500
|
const CURRENT_PLATFORM="gm-copilot-cli";
|
package/manifest.yml
CHANGED
package/package.json
CHANGED