@kenkaiiii/ggcoder 5.102.0 → 5.104.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 (51) hide show
  1. package/README.md +1 -1
  2. package/assets/motion/fonts/anybody/OFL.txt +93 -93
  3. package/assets/motion/fonts/finger-paint/OFL.txt +93 -93
  4. package/assets/skills/gg-guide/references/code-mode.md +11 -0
  5. package/dist/app-error.d.ts +1 -0
  6. package/dist/app-error.js +2 -0
  7. package/dist/app-error.js.map +1 -1
  8. package/dist/app-sidecar/live-preview/dev-url.d.ts +32 -0
  9. package/dist/app-sidecar/live-preview/dev-url.js +97 -0
  10. package/dist/app-sidecar/live-preview/dev-url.js.map +1 -0
  11. package/dist/app-sidecar/live-preview/frame-server.d.ts +31 -0
  12. package/dist/app-sidecar/live-preview/frame-server.js +193 -0
  13. package/dist/app-sidecar/live-preview/frame-server.js.map +1 -0
  14. package/dist/app-sidecar/live-preview/manager.d.ts +44 -0
  15. package/dist/app-sidecar/live-preview/manager.js +215 -0
  16. package/dist/app-sidecar/live-preview/manager.js.map +1 -0
  17. package/dist/app-sidecar/live-preview/proxy.d.ts +30 -0
  18. package/dist/app-sidecar/live-preview/proxy.js +235 -0
  19. package/dist/app-sidecar/live-preview/proxy.js.map +1 -0
  20. package/dist/app-sidecar/live-preview/routes.d.ts +4 -0
  21. package/dist/app-sidecar/live-preview/routes.js +52 -0
  22. package/dist/app-sidecar/live-preview/routes.js.map +1 -0
  23. package/dist/app-sidecar/live-preview/servers.d.ts +36 -0
  24. package/dist/app-sidecar/live-preview/servers.js +228 -0
  25. package/dist/app-sidecar/live-preview/servers.js.map +1 -0
  26. package/dist/app-sidecar/prompt-routes.js +21 -3
  27. package/dist/app-sidecar/prompt-routes.js.map +1 -1
  28. package/dist/app-sidecar.js +73 -30
  29. package/dist/app-sidecar.js.map +1 -1
  30. package/dist/cli.js +3 -3
  31. package/dist/cli.js.map +1 -1
  32. package/dist/core/agent-session/verification-tracker.js +2 -10
  33. package/dist/core/agent-session/verification-tracker.js.map +1 -1
  34. package/dist/core/live-preview.d.ts +24 -0
  35. package/dist/core/live-preview.js +76 -0
  36. package/dist/core/live-preview.js.map +1 -0
  37. package/dist/core/prompt-commands.js +14 -5
  38. package/dist/core/prompt-commands.js.map +1 -1
  39. package/dist/core/session-history.js +15 -3
  40. package/dist/core/session-history.js.map +1 -1
  41. package/dist/core/subagent-policy.js +1 -1
  42. package/dist/core/subagent-policy.js.map +1 -1
  43. package/dist/tools/bash.d.ts +2 -2
  44. package/dist/tools/bash.js +359 -354
  45. package/dist/tools/bash.js.map +1 -1
  46. package/dist/tools/live-preview.d.ts +21 -0
  47. package/dist/tools/live-preview.js +37 -0
  48. package/dist/tools/live-preview.js.map +1 -0
  49. package/dist/ui/components/Footer.js +4 -4
  50. package/dist/ui/components/Footer.js.map +1 -1
  51. package/package.json +4 -4
package/README.md CHANGED
@@ -46,7 +46,7 @@ Switch any time with `/model`.
46
46
  | Provider | Models | Sign-in |
47
47
  | ---------------- | ---------------------------------------------------------------------------------- | -------------------------------------- |
48
48
  | **Anthropic** | Claude Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.5 | Claude or API key |
49
- | **OpenAI** | GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna | Continue with ChatGPT or API key |
49
+ | **OpenAI** | GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra, GPT-6 Luna | Continue with ChatGPT or API key |
50
50
  | **Gemini** | Gemini 3.8 Flash, 3.5 Flash Lite, 3.1 Flash Lite, 3.5 Flash, 3.1 Pro (Preview) | API key (Google AI Studio) |
51
51
  | **xAI** | Grok 4.7 | API key |
52
52
  | **Kimi** | Kimi K3, K2.8 Preview, K2.7 Code, K2.7 Code HighSpeed | Kimi Code plan key or Moonshot API key |
@@ -1,93 +1,93 @@
1
- Copyright 2020 The Anybody Project Authors (https://github.com/Etcetera-Type-Co/Anybody)
2
-
3
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
- This license is copied below, and is also available with a FAQ at:
5
- https://scripts.sil.org/OFL
6
-
7
-
8
- -----------------------------------------------------------
9
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
- -----------------------------------------------------------
11
-
12
- PREAMBLE
13
- The goals of the Open Font License (OFL) are to stimulate worldwide
14
- development of collaborative font projects, to support the font creation
15
- efforts of academic and linguistic communities, and to provide a free and
16
- open framework in which fonts may be shared and improved in partnership
17
- with others.
18
-
19
- The OFL allows the licensed fonts to be used, studied, modified and
20
- redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
22
- redistributed and/or sold with any software provided that any reserved
23
- names are not used by derivative works. The fonts and derivatives,
24
- however, cannot be released under any other type of license. The
25
- requirement for fonts to remain under this license does not apply
26
- to any document created using the fonts or their derivatives.
27
-
28
- DEFINITIONS
29
- "Font Software" refers to the set of files released by the Copyright
30
- Holder(s) under this license and clearly marked as such. This may
31
- include source files, build scripts and documentation.
32
-
33
- "Reserved Font Name" refers to any names specified as such after the
34
- copyright statement(s).
35
-
36
- "Original Version" refers to the collection of Font Software components as
37
- distributed by the Copyright Holder(s).
38
-
39
- "Modified Version" refers to any derivative made by adding to, deleting,
40
- or substituting -- in part or in whole -- any of the components of the
41
- Original Version, by changing formats or by porting the Font Software to a
42
- new environment.
43
-
44
- "Author" refers to any designer, engineer, programmer, technical
45
- writer or other person who contributed to the Font Software.
46
-
47
- PERMISSION & CONDITIONS
48
- Permission is hereby granted, free of charge, to any person obtaining
49
- a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
- redistribute, and sell modified and unmodified copies of the Font
51
- Software, subject to the following conditions:
52
-
53
- 1) Neither the Font Software nor any of its individual components,
54
- in Original or Modified Versions, may be sold by itself.
55
-
56
- 2) Original or Modified Versions of the Font Software may be bundled,
57
- redistributed and/or sold with any software, provided that each copy
58
- contains the above copyright notice and this license. These can be
59
- included either as stand-alone text files, human-readable headers or
60
- in the appropriate machine-readable metadata fields within text or
61
- binary files as long as those fields can be easily viewed by the user.
62
-
63
- 3) No Modified Version of the Font Software may use the Reserved Font
64
- Name(s) unless explicit written permission is granted by the corresponding
65
- Copyright Holder. This restriction only applies to the primary font name as
66
- presented to the users.
67
-
68
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
- Software shall not be used to promote, endorse or advertise any
70
- Modified Version, except to acknowledge the contribution(s) of the
71
- Copyright Holder(s) and the Author(s) or with their explicit written
72
- permission.
73
-
74
- 5) The Font Software, modified or unmodified, in part or in whole,
75
- must be distributed entirely under this license, and must not be
76
- distributed under any other license. The requirement for fonts to
77
- remain under this license does not apply to any document created
78
- using the Font Software.
79
-
80
- TERMINATION
81
- This license becomes null and void if any of the above conditions are
82
- not met.
83
-
84
- DISCLAIMER
85
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
1
+ Copyright 2020 The Anybody Project Authors (https://github.com/Etcetera-Type-Co/Anybody)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -1,93 +1,93 @@
1
- Copyright (c) 2011 by Ralph du Carrois, with Reserved Font Name 'Finger Paint'
2
-
3
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
- This license is copied below, and is also available with a FAQ at:
5
- http://scripts.sil.org/OFL
6
-
7
-
8
- -----------------------------------------------------------
9
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
- -----------------------------------------------------------
11
-
12
- PREAMBLE
13
- The goals of the Open Font License (OFL) are to stimulate worldwide
14
- development of collaborative font projects, to support the font creation
15
- efforts of academic and linguistic communities, and to provide a free and
16
- open framework in which fonts may be shared and improved in partnership
17
- with others.
18
-
19
- The OFL allows the licensed fonts to be used, studied, modified and
20
- redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
22
- redistributed and/or sold with any software provided that any reserved
23
- names are not used by derivative works. The fonts and derivatives,
24
- however, cannot be released under any other type of license. The
25
- requirement for fonts to remain under this license does not apply
26
- to any document created using the fonts or their derivatives.
27
-
28
- DEFINITIONS
29
- "Font Software" refers to the set of files released by the Copyright
30
- Holder(s) under this license and clearly marked as such. This may
31
- include source files, build scripts and documentation.
32
-
33
- "Reserved Font Name" refers to any names specified as such after the
34
- copyright statement(s).
35
-
36
- "Original Version" refers to the collection of Font Software components as
37
- distributed by the Copyright Holder(s).
38
-
39
- "Modified Version" refers to any derivative made by adding to, deleting,
40
- or substituting -- in part or in whole -- any of the components of the
41
- Original Version, by changing formats or by porting the Font Software to a
42
- new environment.
43
-
44
- "Author" refers to any designer, engineer, programmer, technical
45
- writer or other person who contributed to the Font Software.
46
-
47
- PERMISSION & CONDITIONS
48
- Permission is hereby granted, free of charge, to any person obtaining
49
- a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
- redistribute, and sell modified and unmodified copies of the Font
51
- Software, subject to the following conditions:
52
-
53
- 1) Neither the Font Software nor any of its individual components,
54
- in Original or Modified Versions, may be sold by itself.
55
-
56
- 2) Original or Modified Versions of the Font Software may be bundled,
57
- redistributed and/or sold with any software, provided that each copy
58
- contains the above copyright notice and this license. These can be
59
- included either as stand-alone text files, human-readable headers or
60
- in the appropriate machine-readable metadata fields within text or
61
- binary files as long as those fields can be easily viewed by the user.
62
-
63
- 3) No Modified Version of the Font Software may use the Reserved Font
64
- Name(s) unless explicit written permission is granted by the corresponding
65
- Copyright Holder. This restriction only applies to the primary font name as
66
- presented to the users.
67
-
68
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
- Software shall not be used to promote, endorse or advertise any
70
- Modified Version, except to acknowledge the contribution(s) of the
71
- Copyright Holder(s) and the Author(s) or with their explicit written
72
- permission.
73
-
74
- 5) The Font Software, modified or unmodified, in part or in whole,
75
- must be distributed entirely under this license, and must not be
76
- distributed under any other license. The requirement for fonts to
77
- remain under this license does not apply to any document created
78
- using the Font Software.
79
-
80
- TERMINATION
81
- This license becomes null and void if any of the above conditions are
82
- not met.
83
-
84
- DISCLAIMER
85
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
1
+ Copyright (c) 2011 by Ralph du Carrois, with Reserved Font Name 'Finger Paint'
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -55,6 +55,15 @@ A Code-mode window is one session on one project folder. You type in the compose
55
55
  - Commands in the added folder's `.gg/commands` show up in the `/` menu.
56
56
  - To drop one again, click **Remove folder** (it appears right after **Add folder** once a folder is added). The **Added folders** panel lists each folder with its own **Remove** key.
57
57
 
58
+ ## Live preview
59
+
60
+ - Click **Live preview** in the **More** panel (the ⋯ key on the bottom bar). GG finds this project's running dev server, whether GG started it or you ran it in your own terminal, opens the app in your normal browser and puts its chat at the bottom of the page. Nothing to install. The key's light is on while the preview runs.
61
+ - If no dev server is running for the project, click **Start dev server**: GG starts it in the background and opens the preview. **Other address** lets you type one instead, for example `localhost:3000`. https dev servers aren't supported yet.
62
+ - Each window previews only its own project, so several projects can each have a preview open at once. When a project runs more than one server, such as a site and its API, GG picks the one that serves a web page.
63
+ - On the page, click the pointer key next to the message box, then click any element, or just right-click it (Shift+right-click keeps the browser's menu). Your message goes to GG with that element. Esc drops the picked element and lets you pick another; Esc again leaves pick mode. The minus key tucks the chat away.
64
+ - The preview has its own chat, separate from the window's conversation. The panel shows the link with **Open** and **Stop**. Closing the window stops it.
65
+ - The preview runs on its own port, so sign-in redirects and saved browser data from your dev server's port don't carry over.
66
+
58
67
  ## Slash commands
59
68
 
60
69
  Type `/` to open the menu. You only see commands in a Code-mode window.
@@ -200,6 +209,8 @@ Q: How do I add tasks and run them?
200
209
  A: Ask GG to add tasks, then open **Tasks** in the deck and click **Run** or **Run all**.
201
210
  Q: How do I add my own slash command?
202
211
  A: Put a Markdown file in the project's `.gg/commands/` folder. Its file name becomes the command, unless a `name:` line at the top sets another name.
212
+ Q: How do I see my web app and talk to GG from it?
213
+ A: Click **Live preview** in the **More** panel (the ⋯ key). If your dev server isn't running yet, click **Start dev server**. Your app opens in the browser with GG's chat on it; right-click an element to ask about it.
203
214
  Q: How do I work on two folders at once?
204
215
  A: Click **Add folder** in the **More** panel (the ⋯ key on the bottom bar) and pick the folder. To drop it, click **Remove folder** and then **Remove** next to it.
205
216
  Q: Where can I keep private notes?
@@ -12,6 +12,7 @@ declare const appErrorSchema: z.ZodObject<{
12
12
  requestId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
13
13
  occurredAt: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
14
14
  resetsAt: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
15
+ manageUsage: z.ZodCatch<z.ZodOptional<z.ZodLiteral<"chatgpt">>>;
15
16
  }, z.core.$strip>;
16
17
  export type AppErrorPayload = z.infer<typeof appErrorSchema>;
17
18
  /** The same sanitized snapshot goes to SSE and the append-only history marker. */
package/dist/app-error.js CHANGED
@@ -14,6 +14,7 @@ const appErrorSchema = z.object({
14
14
  requestId: z.string().max(300).optional().catch(undefined),
15
15
  occurredAt: timestamp,
16
16
  resetsAt: timestamp,
17
+ manageUsage: z.literal("chatgpt").optional().catch(undefined),
17
18
  });
18
19
  /** The same sanitized snapshot goes to SSE and the append-only history marker. */
19
20
  export function createAppErrorPayload(error, scope, occurredAt, secrets) {
@@ -29,6 +30,7 @@ export function createAppErrorPayload(error, scope, occurredAt, secrets) {
29
30
  requestId: error.requestId,
30
31
  occurredAt,
31
32
  resetsAt: error.resetsAt,
33
+ manageUsage: error.manageUsage,
32
34
  }, { secrets, maxStringLength: 8_000 });
33
35
  }
34
36
  /** Backward-compatible read: no migration or reclassification of old saved text. */
@@ -1 +1 @@
1
- {"version":3,"file":"app-error.js","sourceRoot":"","sources":["../src/app-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AAExE,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACpG,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACvE,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;IACtC,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,CAAC,CAA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MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { BackgroundProcess } from "../../core/process-manager.js";
2
+ import type { Probe } from "./servers.js";
3
+ export type DevUrlResult = {
4
+ kind: "found";
5
+ url: string;
6
+ command: string;
7
+ } | {
8
+ kind: "https";
9
+ url: string;
10
+ command: string;
11
+ } | {
12
+ kind: "none";
13
+ };
14
+ /** The last local URL in some log text, normalised to localhost; null when none. */
15
+ export declare function lastLocalUrl(text: string): {
16
+ url: string;
17
+ https: boolean;
18
+ } | null;
19
+ export interface DetectOptions {
20
+ /** The window's project. */
21
+ cwd?: string;
22
+ /** Ports of servers running from inside `cwd` that GG didn't start (servers.ts). */
23
+ scan?: (cwd: string) => Promise<number[]>;
24
+ /** What answers on a port; without it the newest printed URL wins unchecked. */
25
+ probe?: (port: number) => Promise<Probe>;
26
+ }
27
+ /**
28
+ * The project's dev server: from the window's background process logs, then from
29
+ * servers running inside the project that the user started themselves. With a
30
+ * probe, only one serving a web page counts (a frontend, never its API).
31
+ */
32
+ export declare function detectDevUrl(processes: readonly BackgroundProcess[], read?: (file: string) => Promise<string>, opts?: DetectOptions): Promise<DevUrlResult>;
@@ -0,0 +1,97 @@
1
+ // Finds the window's dev server: a local URL its background processes printed
2
+ // (Vite's "Local:", Next's "- Local:", etc.), or a server the user started in
3
+ // the project themselves; one serving a web page beats an API.
4
+ import fs from "node:fs/promises";
5
+ const TAIL_BYTES = 64 * 1024;
6
+ // eslint-disable-next-line no-control-regex
7
+ const ANSI = /\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)/g;
8
+ const LOCAL_URL = /\b(https?):\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\]):(\d{2,5})(\/[^\s'"<>`)\]]*)?/gi;
9
+ /** The last local URL in some log text, normalised to localhost; null when none. */
10
+ export function lastLocalUrl(text) {
11
+ let last = null;
12
+ for (const m of text.replace(ANSI, "").matchAll(LOCAL_URL))
13
+ last = m;
14
+ if (!last)
15
+ return null;
16
+ const [, scheme, , port, rest] = last;
17
+ const p = Number(port);
18
+ if (!Number.isInteger(p) || p < 1 || p > 65535)
19
+ return null;
20
+ // 0.0.0.0 and ::1 are the same machine; a browser reaches either as localhost.
21
+ const pathPart = (rest ?? "/").replace(/[.,;:]+$/, "") || "/";
22
+ return {
23
+ url: `${scheme.toLowerCase()}://localhost:${p}${pathPart}`,
24
+ https: /^https$/i.test(scheme),
25
+ };
26
+ }
27
+ async function readTail(file) {
28
+ const handle = await fs.open(file, "r");
29
+ try {
30
+ const { size } = await handle.stat();
31
+ const start = Math.max(0, size - TAIL_BYTES);
32
+ const buf = Buffer.alloc(size - start);
33
+ await handle.read(buf, 0, buf.length, start);
34
+ return buf.toString("utf8");
35
+ }
36
+ finally {
37
+ await handle.close();
38
+ }
39
+ }
40
+ /** One local URL per background process that printed one: running first, newest first. */
41
+ async function logCandidates(processes, read) {
42
+ const ordered = [...processes].sort((a, b) => Number(a.exitCode !== null) - Number(b.exitCode !== null) || b.startedAt - a.startedAt);
43
+ const found = [];
44
+ for (const p of ordered) {
45
+ const text = await read(p.logFile).catch(() => "");
46
+ const url = lastLocalUrl(text);
47
+ if (url)
48
+ found.push({ ...url, command: p.command, live: p.exitCode === null, printed: true });
49
+ }
50
+ return found;
51
+ }
52
+ const portOf = (url) => Number(new URL(url).port || 80);
53
+ // Only a web page (or one still compiling) can be previewed: an API never is. An https dev
54
+ // server is reported rather than skipped.
55
+ const RANK = { html: 0, https: 1, slow: 2, http: 9, none: 9 };
56
+ /**
57
+ * The project's dev server: from the window's background process logs, then from
58
+ * servers running inside the project that the user started themselves. With a
59
+ * probe, only one serving a web page counts (a frontend, never its API).
60
+ */
61
+ export async function detectDevUrl(processes, read = readTail, opts = {}) {
62
+ const candidates = await logCandidates(processes, read);
63
+ if (opts.scan && opts.cwd) {
64
+ const seen = new Set(candidates.map((c) => portOf(c.url)));
65
+ for (const port of await opts.scan(opts.cwd).catch(() => [])) {
66
+ if (seen.has(port))
67
+ continue;
68
+ seen.add(port);
69
+ candidates.push({
70
+ url: `http://localhost:${port}/`,
71
+ https: false,
72
+ command: "a dev server started outside GG Coder",
73
+ live: true,
74
+ printed: false,
75
+ });
76
+ }
77
+ }
78
+ const result = (c) => ({
79
+ kind: c.https ? "https" : "found",
80
+ url: c.url,
81
+ command: c.command,
82
+ });
83
+ const probe = opts.probe;
84
+ if (!probe)
85
+ return candidates[0] ? result(candidates[0]) : { kind: "none" };
86
+ const ranked = await Promise.all(candidates
87
+ .filter((c) => c.live)
88
+ .slice(0, 12)
89
+ .map(async (c) => ({ c, rank: RANK[c.https ? "https" : await probe(portOf(c.url))] })));
90
+ const best = ranked.reduce((a, b) => (b.rank < RANK.none && (!a || b.rank < a.rank) ? b : a), null);
91
+ if (best)
92
+ return result(best.c);
93
+ // Nothing answers: the newest printed address, so the preview shows "start your dev server".
94
+ const printed = candidates.find((c) => c.printed);
95
+ return printed ? result(printed) : { kind: "none" };
96
+ }
97
+ //# sourceMappingURL=dev-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-url.js","sourceRoot":"","sources":["../../../src/app-sidecar/live-preview/dev-url.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,+DAA+D;AAC/D,OAAO,EAAE,MAAM,kBAAkB,CAAC;AASlC,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC;AAC7B,4CAA4C;AAC5C,MAAM,IAAI,GAAG,0EAA0E,CAAC;AACxF,MAAM,SAAS,GACb,2FAA2F,CAAC;AAE9F,oFAAoF;AACpF,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI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AACtD,CAAC"}
@@ -0,0 +1,31 @@
1
+ import http from "node:http";
2
+ import type { SessionContext } from "../session-types.js";
3
+ export declare const LIVE_HEADER = "x-gg-live";
4
+ export interface FrameConfig {
5
+ /** The dev server the agent is told about (not the proxy). */
6
+ devUrl: string;
7
+ /** Origins the page proxy is reachable at; the only parents the frame talks to. */
8
+ proxyOrigins: string[];
9
+ }
10
+ export interface FrameServerOptions {
11
+ assetsDir: string;
12
+ session: () => SessionContext | null;
13
+ config: () => FrameConfig;
14
+ /** SSE frames broadcast so far, so a reloaded page rebuilds its transcript. */
15
+ replay: () => readonly string[];
16
+ usage: (provider: "anthropic" | "moonshot") => Promise<unknown>;
17
+ }
18
+ export interface FrameServer {
19
+ server: http.Server;
20
+ listen: (port: number) => Promise<number>;
21
+ close: () => Promise<void>;
22
+ origin: () => string;
23
+ }
24
+ /**
25
+ * Whether an API request comes from the frame itself. Exported for tests.
26
+ * The custom header can't be sent cross-origin without a preflight, and we
27
+ * answer every preflight without CORS headers, so browsers block it.
28
+ */
29
+ export declare function fromFrame(req: http.IncomingMessage, frameOrigin: string): boolean;
30
+ export declare function frameCsp(proxyOrigins: readonly string[]): string;
31
+ export declare function createFrameServer(opts: FrameServerOptions): FrameServer;