@kenkaiiii/ggcoder 5.86.3 → 5.87.1

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 (105) hide show
  1. package/README.md +23 -32
  2. package/assets/skills/bulletproof/SKILL.md +3 -1
  3. package/assets/skills/compliance-guard/SKILL.md +1 -1
  4. package/assets/skills/durable/SKILL.md +1 -1
  5. package/assets/skills/lean/SKILL.md +3 -1
  6. package/dist/app-sidecar/progress-manager.d.ts +2 -20
  7. package/dist/app-sidecar/progress-manager.js +2 -15
  8. package/dist/app-sidecar/progress-manager.js.map +1 -1
  9. package/dist/app-sidecar/royale.d.ts +26 -24
  10. package/dist/app-sidecar/royale.js +85 -187
  11. package/dist/app-sidecar/royale.js.map +1 -1
  12. package/dist/app-sidecar.js +32 -40
  13. package/dist/app-sidecar.js.map +1 -1
  14. package/dist/config.d.ts +12 -0
  15. package/dist/config.js +24 -94
  16. package/dist/config.js.map +1 -1
  17. package/dist/core/autopilot-gate.js +2 -3
  18. package/dist/core/autopilot-gate.js.map +1 -1
  19. package/dist/core/bundled-agents.js +7 -27
  20. package/dist/core/bundled-agents.js.map +1 -1
  21. package/dist/core/checklist-items.d.ts +0 -8
  22. package/dist/core/checklist-items.js +0 -8
  23. package/dist/core/checklist-items.js.map +1 -1
  24. package/dist/core/code-retrieval.d.ts +1 -1
  25. package/dist/core/code-retrieval.js +2 -2
  26. package/dist/core/code-retrieval.js.map +1 -1
  27. package/dist/core/mcp/deferred-catalog.d.ts +1 -1
  28. package/dist/core/mcp/deferred-catalog.js +1 -1
  29. package/dist/core/prompt-commands.js +0 -99
  30. package/dist/core/prompt-commands.js.map +1 -1
  31. package/dist/core/skills.d.ts +6 -0
  32. package/dist/core/skills.js +11 -3
  33. package/dist/core/skills.js.map +1 -1
  34. package/dist/core/style-packs/packs.js +1 -1
  35. package/dist/core/subagent-policy.d.ts +6 -0
  36. package/dist/core/subagent-policy.js +21 -2
  37. package/dist/core/subagent-policy.js.map +1 -1
  38. package/dist/core/subagent-receipt.d.ts +2 -2
  39. package/dist/core/subagent-receipt.js +5 -8
  40. package/dist/core/subagent-receipt.js.map +1 -1
  41. package/dist/core/trophies/catalog-more.js +3 -23
  42. package/dist/core/trophies/catalog-more.js.map +1 -1
  43. package/dist/core/trophies/engine.js +0 -4
  44. package/dist/core/trophies/engine.js.map +1 -1
  45. package/dist/core/trophies/types.d.ts +1 -1
  46. package/dist/core/trophies/types.js +0 -2
  47. package/dist/core/trophies/types.js.map +1 -1
  48. package/dist/goals-agent/goal-team.js +3 -4
  49. package/dist/goals-agent/goal-team.js.map +1 -1
  50. package/dist/modes/acp-mode.js +0 -1
  51. package/dist/modes/acp-mode.js.map +1 -1
  52. package/dist/system-prompt.js +1 -0
  53. package/dist/system-prompt.js.map +1 -1
  54. package/dist/tools/index.d.ts +0 -2
  55. package/dist/tools/index.js +0 -6
  56. package/dist/tools/index.js.map +1 -1
  57. package/dist/tools/operations.js +1 -1
  58. package/dist/tools/operations.js.map +1 -1
  59. package/dist/tools/prompt-hints.js +0 -6
  60. package/dist/tools/prompt-hints.js.map +1 -1
  61. package/dist/tools/skill.js +11 -5
  62. package/dist/tools/skill.js.map +1 -1
  63. package/dist/tools/tool-tiers.d.ts +2 -1
  64. package/dist/tools/tool-tiers.js +2 -3
  65. package/dist/tools/tool-tiers.js.map +1 -1
  66. package/dist/ui/App.js +0 -1
  67. package/dist/ui/App.js.map +1 -1
  68. package/dist/ui/components/SkillsOverlay.js +2 -1
  69. package/dist/ui/components/SkillsOverlay.js.map +1 -1
  70. package/package.json +6 -5
  71. package/assets/skills/clarify/SKILL.md +0 -39
  72. package/assets/skills/code-review/SKILL.md +0 -82
  73. package/assets/skills/code-review/references/agent-diffs.md +0 -27
  74. package/assets/skills/code-review/references/tests.md +0 -19
  75. package/assets/skills/evidence-led-ui/LICENSES.md +0 -79
  76. package/assets/skills/evidence-led-ui/SKILL.md +0 -95
  77. package/assets/skills/evidence-led-ui/references/anti-defaults.md +0 -110
  78. package/assets/skills/evidence-led-ui/references/archetypes.md +0 -97
  79. package/assets/skills/evidence-led-ui/references/craft-rulings.md +0 -242
  80. package/assets/skills/evidence-led-ui/references/direction.md +0 -116
  81. package/assets/skills/evidence-led-ui/references/methodology.md +0 -64
  82. package/assets/skills/evidence-led-ui/references/observed-patterns.md +0 -68
  83. package/assets/skills/evidence-led-ui/references/production-contract.md +0 -148
  84. package/assets/skills/evidence-led-ui/references/provenance.md +0 -142
  85. package/assets/skills/evidence-led-ui/references/quality-rubric.md +0 -126
  86. package/assets/skills/evidence-led-ui/references/ui-libraries.md +0 -30
  87. package/assets/skills/refactoring/SKILL.md +0 -72
  88. package/assets/skills/refactoring/references/agent-pitfalls.md +0 -46
  89. package/assets/skills/refactoring/references/legacy.md +0 -70
  90. package/assets/skills/refactoring/references/smells.md +0 -71
  91. package/assets/skills/root-cause/SKILL.md +0 -46
  92. package/assets/skills/shared-language/SKILL.md +0 -32
  93. package/assets/skills/tdd/SKILL.md +0 -42
  94. package/dist/app-sidecar/royale-bug.d.ts +0 -19
  95. package/dist/app-sidecar/royale-bug.js +0 -112
  96. package/dist/app-sidecar/royale-bug.js.map +0 -1
  97. package/dist/app-sidecar/royale-deploy.d.ts +0 -5
  98. package/dist/app-sidecar/royale-deploy.js +0 -76
  99. package/dist/app-sidecar/royale-deploy.js.map +0 -1
  100. package/dist/tools/code-nav.d.ts +0 -29
  101. package/dist/tools/code-nav.js +0 -299
  102. package/dist/tools/code-nav.js.map +0 -1
  103. package/dist/tools/search-code.d.ts +0 -10
  104. package/dist/tools/search-code.js +0 -90
  105. package/dist/tools/search-code.js.map +0 -1
package/README.md CHANGED
@@ -67,21 +67,21 @@ You can still add your own MCPs in `~/.gg/mcp.json` or `.gg/mcp.json`. But start
67
67
 
68
68
  Switch mid-conversation with `/model`. Not locked to anyone.
69
69
 
70
- | Provider | Models | Auth |
71
- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------- |
72
- | **Anthropic** | Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5 | OAuth |
73
- | **OpenAI** | GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna | OAuth |
74
- | **Gemini** | Gemini 3.1 Pro (Preview), 3.8 Flash, 3.5 Flash, 3.5 Flash Lite, 3.1 Flash Lite | OAuth |
75
- | **xAI (Grok)** | Grok 4.7 | OAuth or API key |
76
- | **Moonshot** | Kimi K3, K2.8 Preview (Kimi sign-in), K2.7 Code, K2.7 Code HighSpeed | OAuth or API key |
77
- | **Z.AI (GLM)** | GLM-5.3, GLM-5.3-Flash | API key |
78
- | **MiniMax** | MiniMax M3 | API key |
79
- | **Xiaomi (MiMo)** | MiMo-V2.6-Pro, MiMo-V2.6-Flash, MiMo-V2.6-Pro-UltraSpeed | API key |
80
- | **DeepSeek** | DeepSeek V4 Pro, V4.1 Flash | API key |
81
- | **Sakana (Fugu)** | Fugu, Fugu Max, Fugu Ultra | API key |
82
- | **OpenRouter** | Qwen3.8 Max | API key |
83
- | **Hugging Face** | Kimi K2.7 Code, DeepSeek V4.1 Flash, GPT-OSS 120B (Inference Providers router) | API key |
84
- | **Local** | Any model on an OpenAI-compatible server: Ollama, LM Studio, llama.cpp, vLLM | None |
70
+ | Provider | Models | Auth |
71
+ | ----------------- | ------------------------------------------------------------------------------ | ---------------- |
72
+ | **Anthropic** | Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5 | OAuth |
73
+ | **OpenAI** | GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna | OAuth |
74
+ | **Gemini** | Gemini 3.1 Pro (Preview), 3.8 Flash, 3.5 Flash, 3.5 Flash Lite, 3.1 Flash Lite | OAuth |
75
+ | **xAI (Grok)** | Grok 4.7 | OAuth or API key |
76
+ | **Moonshot** | Kimi K3, K2.8 Preview (Kimi sign-in), K2.7 Code, K2.7 Code HighSpeed | OAuth or API key |
77
+ | **Z.AI (GLM)** | GLM-5.3, GLM-5.3-Flash | API key |
78
+ | **MiniMax** | MiniMax M3 | API key |
79
+ | **Xiaomi (MiMo)** | MiMo-V2.6-Pro, MiMo-V2.6-Flash, MiMo-V2.6-Pro-UltraSpeed | API key |
80
+ | **DeepSeek** | DeepSeek V4 Pro, V4.1 Flash | API key |
81
+ | **Sakana (Fugu)** | Fugu, Fugu Max, Fugu Ultra | API key |
82
+ | **OpenRouter** | Qwen3.8 Max | API key |
83
+ | **Hugging Face** | Kimi K2.7 Code, DeepSeek V4.1 Flash, GPT-OSS 120B (Inference Providers router) | API key |
84
+ | **Local** | Any model on an OpenAI-compatible server: Ollama, LM Studio, llama.cpp, vLLM | None |
85
85
 
86
86
  Every hosted model above except GLM-5.3, DeepSeek V4 Pro, and GPT-OSS 120B accepts images.
87
87
 
@@ -131,7 +131,6 @@ Plus built-in workflows that ship with the binary:
131
131
  /init # Generate or update AGENTS.md / CLAUDE.md for your project
132
132
  /setup-commit # Generate a /commit command with quality checks
133
133
  /setup-ci # Set up or harden CI for any stack
134
- /setup-skills # Audit and recommend reusable skills
135
134
  /compare # Compare your code against real-world code
136
135
  /steroids # Index real repos like this project
137
136
  ```
@@ -152,7 +151,6 @@ GG Coder comes with a focused set of tools. Only six core tools — `read`, `wri
152
151
  | `skill` | Load a skill's instructions |
153
152
  | `tool_search` | Load an on-demand tool by capability |
154
153
  | `find` / `ls` | Find files by glob pattern / list a directory |
155
- | `code_search` / `code_nav` | Find code by meaning / jump to exact definitions and callers |
156
154
  | `web_fetch` / `web_search` | Fetch a URL / search the web |
157
155
  | `steroids` | Find real production repos similar to yours and read how they do it |
158
156
  | `source_path` | Locate an installed dependency's source |
@@ -203,21 +201,14 @@ Reusable behaviors across projects. Drop `.md` files in:
203
201
 
204
202
  They get loaded into the system prompt automatically. The agent knows what it can do without you explaining it each session. <kbd>Ctrl+S</kbd> opens a pane to browse and toggle them.
205
203
 
206
- Eleven ship built in, and route themselves when the work matches:
207
-
208
- | Skill | Fires on |
209
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
210
- | `bulletproof` | Code an attacker will reach — auth, untrusted input, secrets, dependencies, CI/release, agent/MCP tool surfaces — and "is this safe to ship" reviews. Works on any target: web, API, CLI, desktop, mobile, embedded, contracts, ML. |
211
- | `clarify` | Requirements or a design genuinely unsettled — interrogating or stress-testing a plan before building, or a mid-build decision that materially changes the result. |
212
- | `code-review` | Reviewing written work — a diff, PR, or branch — on both what was asked for and how well it is built. |
213
- | `compliance-guard` | Legal exposure — personal data, payments, UGC, email/SMS, minors, or a licensed/regulated feature. |
214
- | `durable` | User data must not be lost — first database/table, migrations, backfills/imports, destructive operations, backups and recovery; any store (Postgres, MySQL, SQLite, Mongo, serverless). |
215
- | `evidence-led-ui` | Broad or design-sensitive UI work — new screens, redesigns, design systems, accessibility passes. |
216
- | `lean` | Speed and resource efficiency — slow loading/startup, jank, high CPU, memory leaks and hogging, zombie/orphan processes, bundle bloat, dead code/styles, Core Web Vitals; while building anything that should stay fast, or a perf pass on an existing project. Any stack: web, backend, Electron, Tauri, mobile, native, game, ML. |
217
- | `refactoring` | Restructuring existing code without changing behavior — "refactor", "clean up", "reduce tech debt", "modernize" or migrate legacy code; test-guarded steps, revert-on-red, characterization tests for untested code. |
218
- | `root-cause` | A bug that resists the obvious fix, makes no sense, or keeps coming back — gated diagnosis from red repro to ranked hypotheses to regression test. |
219
- | `shared-language` | Fuzzy or drifting domain vocabulary, recurring naming decisions, and hard-to-reverse decisions worth recording (glossary + decision records). |
220
- | `tdd` | Test-driven development — red-green-refactor with pre-agreed seams, when the user asks for test-first work. |
204
+ Two ship built in, and route themselves when the work matches:
205
+
206
+ | Skill | Fires on |
207
+ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
208
+ | `compliance-guard` | Legal exposure — personal data, consent, marketing email/SMS, payments, UGC, minors, or a licensed/regulated feature. |
209
+ | `durable` | User data must not be lost — first database/table, migrations, backfills/imports, destructive operations, backups and recovery; any store (Postgres, MySQL, SQLite, Mongo, serverless). |
210
+
211
+ Two more, `bulletproof` (security) and `lean` (performance), are hidden from routine work and load only for the app's Checklist audits.
221
212
 
222
213
  ---
223
214
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: bulletproof
3
- description: "Use for attacker-reachable code: auth, tokens, crypto, untrusted input, secrets, tenant data, CI, agent tools. Do NOT use for local scripts without auth or network."
3
+ description: "Use to secure code an attacker can reach: finding and fixing ways someone could break in, steal secrets or reach another user's data. Do NOT use for local-only scripts, legal questions or performance."
4
+ # Checklist audits only (Security, Dependencies, Secrets / Performance); hidden from routine coding after the 27 Oct 2026 skill-value bench.
5
+ hidden: true
4
6
  license: Apache-2.0. Content is defensive engineering guidance, not a security certification or a penetration test. See references/provenance.md.
5
7
  compatibility: Works offline from the bundled references, a snapshot dated 22 October 2026. Versions, CVEs and incident details decay fast; re-verify date-sensitive claims with web access before stating them as current. Never certifies that software is secure.
6
8
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: compliance-guard
3
- description: Use when shipping to real users risks legal exposure — privacy, cookies/tracking, payments, minors, AI features, user content, terms. Do NOT use for local-only work or pure security hardening.
3
+ description: "Use for the legal side of shipping to real users: which laws apply, what cannot lawfully ship, and the consent, notices and policies the product owes. Do NOT use for bugs, data leaks or security hardening."
4
4
  license: Apache-2.0. Content is engineering guidance, not legal advice. See references/provenance.md.
5
5
  compatibility: Static review works offline from the bundled references. Legal status changes constantly; date-sensitive claims must be re-verified with web access before being stated as current. Never certifies compliance.
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: durable
3
- description: "Use when data could be lost, or asked whether data is safe: migrations, destructive ops, real databases, backups. Do NOT use for query speed."
3
+ description: "Use to keep stored data from being lost: before running or writing anything that could delete, overwrite or reshape it, and when asked whether data is backed up and recoverable. Do NOT use for read-only queries or query speed."
4
4
  license: Data-durability engineering guidance, not a DBA certification. Sources and snapshot date are recorded at the foot of each reference file.
5
5
  compatibility: Snapshot dated 3 October 2026; Prisma 7/8 status and agent safeguards, PostgreSQL 19 status and the Neon, RDS and D1 retention rows re-verified 22 October 2026. Re-verify version behaviours and provider defaults before asserting them as current.
6
6
  ---
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: lean
3
- description: "Use when speed or resource use matters: slow pages or startup, memory leaks, high CPU, bundle size, N+1 queries. Do NOT use for correctness bugs."
3
+ description: "Use to make software faster or lighter when speed, memory, CPU or size is the problem. Do NOT use for correctness bugs."
4
+ # Checklist audits only (Security, Dependencies, Secrets / Performance); hidden from routine coding after the 27 Oct 2026 skill-value bench.
5
+ hidden: true
4
6
  license: Performance engineering guidance, not a benchmark certification. Sources and snapshot date are recorded at the foot of each reference file.
5
7
  compatibility: Snapshot dated 3 October 2026; Node release schedule, Core Web Vitals browser support and the current Next.js version re-verified 22 October 2026. Thresholds and tool names decay — re-verify before asserting them as current.
6
8
  ---
@@ -1,28 +1,10 @@
1
- import type { RoyaleBugCategory } from "./royale-bug.js";
2
- /** What a finished run did, beyond its commits, for GG Royale. */
3
- export interface RunExtras {
4
- /** The goal this run worked on (its coordinator's run), if any. */
5
- goalId?: string | null;
6
- /** The run handed work to workers (spawn_agent). */
7
- workers?: boolean;
8
- /** A deploy or publish command ran and succeeded. */
9
- deployed?: boolean;
10
- }
11
- /** One run's outcome as GG Royale hears it (counts and labels only). */
12
- export interface RunOutcome extends RunExtras {
13
- commits: number;
14
- bug?: RoyaleBugCategory | null;
15
- }
16
1
  import type { ProgressSnapshot } from "../core/progress/types.js";
17
2
  export interface ProgressManager {
18
3
  /** Current snapshot for GET /progress + the SSE ready path. */
19
4
  snapshot: () => ProgressSnapshot;
20
5
  /** Award XP for one successfully completed run (prompt + any new commits). */
21
- awardRun: (cwd: string, runStartedAt: number, originId?: string, bug?: RoyaleBugCategory | null, extras?: RunExtras) => Promise<void>;
6
+ awardRun: (cwd: string, runStartedAt: number, originId?: string) => Promise<void>;
22
7
  /** Close the ~/.gg fs.watch + clear any pending debounce (leak-free shutdown). */
23
8
  dispose: () => void;
24
9
  }
25
- export declare function createProgressManager(agentDir: string, broadcastAll: (snapshot: ProgressSnapshot, originId?: string) => void,
26
- /** Optional: called after each successful run award with the number of newly
27
- * detected commits (0 if none). Must not throw (GG Royale reporting). */
28
- onRunAwarded?: (outcome: RunOutcome) => void): Promise<ProgressManager>;
10
+ export declare function createProgressManager(agentDir: string, broadcastAll: (snapshot: ProgressSnapshot, originId?: string) => void): Promise<ProgressManager>;
@@ -8,10 +8,7 @@ import { loadProgress, peekProgress, updateProgress } from "../core/progress/sto
8
8
  import { awardPrompt, awardCommits } from "../core/progress/engine.js";
9
9
  import { detectNewCommits, repoKey } from "../core/progress/git-xp.js";
10
10
  import { rebuildFromSessions } from "../core/progress/rebuild.js";
11
- export async function createProgressManager(agentDir, broadcastAll,
12
- /** Optional: called after each successful run award with the number of newly
13
- * detected commits (0 if none). Must not throw (GG Royale reporting). */
14
- onRunAwarded) {
11
+ export async function createProgressManager(agentDir, broadcastAll) {
15
12
  // Boot: recovery chain main → backup → coding + chat session rebuild → empty.
16
13
  const coderSessionsDir = path.join(agentDir, "sessions");
17
14
  let file = await loadProgress({
@@ -29,10 +26,9 @@ onRunAwarded) {
29
26
  function snapshot() {
30
27
  return buildSnapshot(file);
31
28
  }
32
- async function awardRun(cwd, runStartedAt, originId, bug, extras = {}) {
29
+ async function awardRun(cwd, runStartedAt, originId) {
33
30
  try {
34
31
  const now = Date.now();
35
- let newCommits = 0;
36
32
  const updated = await updateProgress(async (f) => {
37
33
  const levelBefore = levelForXp(f.xp);
38
34
  awardPrompt(f, now, cwd);
@@ -46,7 +42,6 @@ onRunAwarded) {
46
42
  const detected = await detectNewCommits(cwd, lastHead, runStartedAt);
47
43
  if (detected && detected.commits.length > 0) {
48
44
  awardCommits(f, detected.commits, now, cwd);
49
- newCommits = detected.commits.length;
50
45
  }
51
46
  }
52
47
  f.repos[key] = { lastHead: probe.head };
@@ -62,14 +57,6 @@ onRunAwarded) {
62
57
  file = updated;
63
58
  lastSeenNonce = updated.lastEvent?.nonce ?? null;
64
59
  broadcastAll(buildSnapshot(updated), originId);
65
- try {
66
- onRunAwarded?.({ commits: newCommits, ...(bug ? { bug } : {}), ...extras });
67
- }
68
- catch (err) {
69
- log("DEBUG", "app-sidecar", "run outcome hook failed", {
70
- message: err instanceof Error ? err.message : String(err),
71
- });
72
- }
73
60
  }
74
61
  catch (err) {
75
62
  log("DEBUG", "app-sidecar", "progress award failed", {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-manager.js","sourceRoot":"","sources":["../../src/app-sidecar/progress-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA0ClE,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,QAAgB,EAChB,YAAqE;AACrE;0EAC0E;AAC1E,YAA4C;IAE5C,8EAA8E;IAC9E,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACzD,IAAI,IAAI,GAAiB,MAAM,YAAY,CAAC;QAC1C,OAAO,EAAE,GAAG,EAA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AK,KAAK,aAAa;wBAAE,OAAO;oBACpC,IAAI,GAAG,QAAQ,CAAC;oBAChB,aAAa,GAAG,KAAK,CAAC;oBACtB,YAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACxC,CAAC,CAAC,EAAE,CAAC;YACP,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,eAAe,GAAG,OAAO,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE;YACxD,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAC,CAAC;IACL,CAAC;IAED,2EAA2E;IAC3E,qEAAqE;IACrE,SAAS,OAAO;QACd,IAAI,aAAa,EAAE,CAAC;YAClB,YAAY,CAAC,aAAa,CAAC,CAAC;YAC5B,aAAa,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,IAAI,CAAC;YACH,eAAe,EAAE,KAAK,EAAE,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,iDAAiD;QACnD,CAAC;QACD,eAAe,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACzC,CAAC"}
@@ -1,38 +1,40 @@
1
- import type { RunOutcome } from "./progress-manager.js";
2
- /** The ONE place the default GG Royale server URL lives. Overridden by
3
- * GG_ROYALE_URL or royale.json `serverUrl`. */
4
- export declare const DEFAULT_ROYALE_URL = "https://gg-royale.buzzbeamaustralia.workers.dev";
1
+ /** The live GG World server. GG_WORLD_URL overrides it. */
2
+ export declare const DEFAULT_WORLD_URL = "https://gg-world.buzzbeamaustralia.workers.dev";
3
+ /** The retired GG Royale server. Links made with it belong to the live World
4
+ * server (same database), so they are never re-registered. */
5
+ export declare const LEGACY_ROYALE_URL = "https://gg-royale.buzzbeamaustralia.workers.dev";
5
6
  export interface RoyaleFile {
6
7
  serverUrl?: string;
7
8
  playerId: string;
8
9
  deviceToken: string;
9
10
  linkedAt: number;
10
11
  }
11
- export interface RoyaleStatus {
12
- linked: boolean;
13
- serverUrl: string;
12
+ /**
13
+ * A World server reply, passed through for the app to read: `status` is the
14
+ * HTTP status (409 stale ver, 400 validation with `body.error`, ...), or 0
15
+ * when the server couldn't be reached. Never throws.
16
+ */
17
+ export interface WorldResult {
18
+ status: number;
19
+ body: unknown;
14
20
  }
15
- export interface RoyaleSummary {
16
- claimable: number;
17
- streak: number;
18
- playing: number;
19
- }
20
- export interface RoyaleOptions {
21
+ export interface WorldLinkOptions {
21
22
  agentDir: string;
22
23
  version: string;
23
24
  env?: NodeJS.ProcessEnv;
24
25
  fetchImpl?: typeof fetch;
25
26
  now?: () => number;
26
27
  }
27
- export interface Royale {
28
- status: () => Promise<RoyaleStatus>;
29
- open: () => Promise<{
30
- url: string;
31
- }>;
32
- unlink: () => Promise<void>;
33
- /** Fire-and-forget; never throws, never awaits the network for the caller. */
34
- reportRun: (input: RunOutcome) => void;
35
- /** Badge counts; null when unlinked or on any error. Never throws. */
36
- summary: () => Promise<RoyaleSummary | null>;
28
+ export interface WorldLink {
29
+ /** GET /api/world/profile. Signs up on first use. */
30
+ worldGet: () => Promise<WorldResult>;
31
+ /** PUT /api/world/profile with `{ ver, patch }`. */
32
+ worldPut: (ver: number, patch: unknown) => Promise<WorldResult>;
33
+ /** DELETE /api/world/me (the online save only). */
34
+ worldDelete: () => Promise<WorldResult>;
35
+ /** POST /api/world/live: a one-time live-world ticket `{ world, ticket, url }`. */
36
+ worldLive: () => Promise<WorldResult>;
37
+ /** DELETE /api/world/account; on success the local link file is removed. */
38
+ accountDelete: () => Promise<WorldResult>;
37
39
  }
38
- export declare function createRoyale(opts: RoyaleOptions): Royale;
40
+ export declare function createWorldLink(opts: WorldLinkOptions): WorldLink;