reigncode-app 1.3.2 → 1.4.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/AGENTS.md +1 -1
- package/e2e/AGENTS.md +1 -1
- package/e2e/actions.ts +4 -4
- package/e2e/app/server-default.spec.ts +1 -1
- package/e2e/fixtures.ts +2 -2
- package/e2e/projects/projects-switch.spec.ts +1 -1
- package/e2e/projects/workspaces.spec.ts +3 -3
- package/e2e/prompt/prompt-drop-file-uri.spec.ts +1 -1
- package/e2e/prompt/prompt-history.spec.ts +1 -1
- package/e2e/prompt/prompt-shell.spec.ts +1 -1
- package/e2e/selectors.ts +1 -1
- package/e2e/session/session-composer-dock.spec.ts +4 -4
- package/e2e/settings/settings.spec.ts +8 -8
- package/e2e/sidebar/sidebar.spec.ts +1 -1
- package/e2e/utils.ts +3 -3
- package/package.json +7 -9
- package/script/e2e-local.ts +9 -9
- package/src/app.tsx +8 -8
- package/src/components/debug-bar.tsx +1 -1
- package/src/components/dialog-connect-provider.tsx +12 -12
- package/src/components/dialog-custom-provider.tsx +7 -7
- package/src/components/dialog-edit-project.tsx +7 -7
- package/src/components/dialog-fork.tsx +6 -6
- package/src/components/dialog-manage-models.tsx +6 -6
- package/src/components/dialog-release-notes.tsx +3 -3
- package/src/components/dialog-select-directory.tsx +6 -6
- package/src/components/dialog-select-file.tsx +8 -8
- package/src/components/dialog-select-mcp.tsx +3 -3
- package/src/components/dialog-select-model-unpaid.tsx +12 -12
- package/src/components/dialog-select-model.tsx +8 -8
- package/src/components/dialog-select-provider.tsx +10 -10
- package/src/components/dialog-select-server.tsx +10 -10
- package/src/components/dialog-settings.tsx +3 -3
- package/src/components/file-tree.test.ts +4 -4
- package/src/components/file-tree.tsx +4 -4
- package/src/components/prompt-input/attachments.ts +1 -1
- package/src/components/prompt-input/build-request-parts.test.ts +2 -2
- package/src/components/prompt-input/build-request-parts.ts +2 -2
- package/src/components/prompt-input/context-items.tsx +4 -4
- package/src/components/prompt-input/drag-overlay.tsx +1 -1
- package/src/components/prompt-input/image-attachments.tsx +1 -1
- package/src/components/prompt-input/slash-popover.tsx +3 -3
- package/src/components/prompt-input/submit.test.ts +3 -3
- package/src/components/prompt-input/submit.ts +4 -4
- package/src/components/prompt-input.tsx +11 -11
- package/src/components/server/server-row.tsx +1 -1
- package/src/components/session/session-context-breakdown.test.ts +1 -1
- package/src/components/session/session-context-breakdown.ts +1 -1
- package/src/components/session/session-context-metrics.test.ts +1 -1
- package/src/components/session/session-context-metrics.ts +1 -1
- package/src/components/session/session-context-tab.tsx +9 -9
- package/src/components/session/session-header.tsx +12 -12
- package/src/components/session/session-new-view.tsx +3 -3
- package/src/components/session/session-sortable-tab.tsx +5 -5
- package/src/components/session/session-sortable-terminal-tab.tsx +4 -4
- package/src/components/session-context-usage.tsx +3 -3
- package/src/components/settings-general.tsx +7 -7
- package/src/components/settings-keybinds.tsx +5 -5
- package/src/components/settings-models.tsx +6 -6
- package/src/components/settings-providers.tsx +10 -10
- package/src/components/status-popover.tsx +7 -7
- package/src/components/terminal.tsx +3 -3
- package/src/components/titlebar.tsx +8 -8
- package/src/context/command.tsx +2 -2
- package/src/context/comments.test.ts +1 -1
- package/src/context/comments.tsx +1 -1
- package/src/context/file/content-cache.ts +1 -1
- package/src/context/file/path.test.ts +6 -6
- package/src/context/file/tree-store.ts +1 -1
- package/src/context/file/types.ts +1 -1
- package/src/context/file/watcher.ts +1 -1
- package/src/context/file.tsx +3 -3
- package/src/context/global-sdk.tsx +2 -2
- package/src/context/global-sync/bootstrap.ts +5 -5
- package/src/context/global-sync/child-store.ts +1 -1
- package/src/context/global-sync/event-reducer.test.ts +1 -1
- package/src/context/global-sync/event-reducer.ts +2 -2
- package/src/context/global-sync/session-cache.test.ts +1 -1
- package/src/context/global-sync/session-cache.ts +1 -1
- package/src/context/global-sync/session-trim.test.ts +1 -1
- package/src/context/global-sync/session-trim.ts +1 -1
- package/src/context/global-sync/types.ts +1 -1
- package/src/context/global-sync/utils.ts +1 -1
- package/src/context/global-sync.tsx +3 -3
- package/src/context/highlights.tsx +2 -2
- package/src/context/language.tsx +18 -18
- package/src/context/layout.tsx +2 -2
- package/src/context/local.tsx +2 -2
- package/src/context/models.tsx +1 -1
- package/src/context/notification.tsx +4 -4
- package/src/context/permission-auto-respond.test.ts +2 -2
- package/src/context/permission-auto-respond.ts +1 -1
- package/src/context/permission.tsx +2 -2
- package/src/context/platform.tsx +1 -1
- package/src/context/prompt.tsx +2 -2
- package/src/context/sdk.tsx +2 -2
- package/src/context/server.tsx +1 -1
- package/src/context/settings.tsx +1 -1
- package/src/context/sync-optimistic.test.ts +1 -1
- package/src/context/sync.tsx +4 -4
- package/src/context/terminal.test.ts +1 -1
- package/src/context/terminal.tsx +1 -1
- package/src/entry.tsx +1 -1
- package/src/hooks/use-providers.ts +3 -3
- package/src/i18n/ar.ts +26 -26
- package/src/i18n/br.ts +26 -26
- package/src/i18n/bs.ts +26 -26
- package/src/i18n/da.ts +26 -26
- package/src/i18n/de.ts +26 -26
- package/src/i18n/en.ts +26 -26
- package/src/i18n/es.ts +26 -26
- package/src/i18n/fr.ts +26 -26
- package/src/i18n/ja.ts +26 -26
- package/src/i18n/ko.ts +26 -26
- package/src/i18n/no.ts +26 -26
- package/src/i18n/pl.ts +26 -26
- package/src/i18n/ru.ts +26 -26
- package/src/i18n/th.ts +26 -26
- package/src/i18n/tr.ts +26 -26
- package/src/i18n/zh.ts +25 -25
- package/src/i18n/zht.ts +25 -25
- package/src/index.css +1 -1
- package/src/pages/directory-layout.tsx +3 -3
- package/src/pages/error.tsx +4 -4
- package/src/pages/home.tsx +5 -5
- package/src/pages/layout/deep-links.ts +2 -2
- package/src/pages/layout/helpers.test.ts +20 -20
- package/src/pages/layout/helpers.ts +2 -2
- package/src/pages/layout/inline-editor.tsx +1 -1
- package/src/pages/layout/sidebar-items.tsx +10 -10
- package/src/pages/layout/sidebar-project.tsx +5 -5
- package/src/pages/layout/sidebar-shell.tsx +2 -2
- package/src/pages/layout/sidebar-workspace.tsx +10 -10
- package/src/pages/layout.tsx +14 -14
- package/src/pages/session/composer/session-composer-region.tsx +1 -1
- package/src/pages/session/composer/session-composer-state.test.ts +1 -1
- package/src/pages/session/composer/session-composer-state.ts +2 -2
- package/src/pages/session/composer/session-followup-dock.tsx +3 -3
- package/src/pages/session/composer/session-permission-dock.tsx +4 -4
- package/src/pages/session/composer/session-question-dock.tsx +5 -5
- package/src/pages/session/composer/session-request-tree.ts +1 -1
- package/src/pages/session/composer/session-revert-dock.tsx +3 -3
- package/src/pages/session/composer/session-todo-dock.tsx +8 -8
- package/src/pages/session/file-tabs.tsx +10 -10
- package/src/pages/session/message-timeline.tsx +16 -16
- package/src/pages/session/review-tab.tsx +3 -3
- package/src/pages/session/session-model-helpers.test.ts +1 -1
- package/src/pages/session/session-model-helpers.ts +1 -1
- package/src/pages/session/session-side-panel.tsx +6 -6
- package/src/pages/session/terminal-panel.tsx +4 -4
- package/src/pages/session/use-session-commands.tsx +5 -5
- package/src/pages/session/use-session-hash-scroll.ts +1 -1
- package/src/pages/session.tsx +10 -10
- package/src/testing/session-composer.ts +2 -2
- package/src/theme-preload.test.ts +8 -8
- package/src/utils/base64.ts +1 -1
- package/src/utils/persist.test.ts +11 -11
- package/src/utils/persist.ts +4 -4
- package/src/utils/prompt.test.ts +1 -1
- package/src/utils/prompt.ts +1 -1
- package/src/utils/server-errors.test.ts +2 -2
- package/src/utils/server.ts +2 -2
- package/src/utils/sound.ts +45 -45
- package/src/utils/worktree.test.ts +1 -1
package/AGENTS.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Local Dev
|
|
6
6
|
|
|
7
|
-
- `
|
|
7
|
+
- `reigncode.dev web` proxies `https://app.code.reign-labs.com`, so local UI/CSS changes will not show there.
|
|
8
8
|
- For local UI changes, run the backend and app dev servers separately.
|
|
9
9
|
- Backend (from `packages/reigncode`): `bun run --conditions=browser ./src/index.ts serve --port 4096`
|
|
10
10
|
- App (from `packages/app`): `bun dev -- --port 4444`
|
package/e2e/AGENTS.md
CHANGED
|
@@ -59,7 +59,7 @@ test("test description", async ({ page, sdk, gotoSession }) => {
|
|
|
59
59
|
### Using Fixtures
|
|
60
60
|
|
|
61
61
|
- `page` - Playwright page
|
|
62
|
-
- `sdk` -
|
|
62
|
+
- `sdk` - ReignCode SDK client for API calls
|
|
63
63
|
- `gotoSession(sessionID?)` - Navigate to session
|
|
64
64
|
|
|
65
65
|
### Helper Functions
|
package/e2e/actions.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { base64Decode, base64Encode } from "
|
|
1
|
+
import { base64Decode, base64Encode } from "reigncode-util/encode"
|
|
2
2
|
import { expect, type Locator, type Page } from "@playwright/test"
|
|
3
3
|
import fs from "node:fs/promises"
|
|
4
4
|
import os from "node:os"
|
|
@@ -315,7 +315,7 @@ export async function openSettings(page: Page) {
|
|
|
315
315
|
export async function seedProjects(page: Page, input: { directory: string; extra?: string[] }) {
|
|
316
316
|
await page.addInitScript(
|
|
317
317
|
(args: { directory: string; serverUrl: string; extra: string[] }) => {
|
|
318
|
-
const key = "
|
|
318
|
+
const key = "reigncode.global.dat:server"
|
|
319
319
|
const raw = localStorage.getItem(key)
|
|
320
320
|
const parsed = (() => {
|
|
321
321
|
if (!raw) return undefined
|
|
@@ -367,13 +367,13 @@ export async function seedProjects(page: Page, input: { directory: string; extra
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
export async function createTestProject() {
|
|
370
|
-
const root = await fs.mkdtemp(path.join(os.tmpdir(), "
|
|
370
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), "reigncode-e2e-project-"))
|
|
371
371
|
const id = `e2e-${path.basename(root)}`
|
|
372
372
|
|
|
373
373
|
await fs.writeFile(path.join(root, "README.md"), `# e2e\n\n${id}\n`)
|
|
374
374
|
|
|
375
375
|
execSync("git init", { cwd: root, stdio: "ignore" })
|
|
376
|
-
await fs.writeFile(path.join(root, ".git", "
|
|
376
|
+
await fs.writeFile(path.join(root, ".git", "reigncode"), id)
|
|
377
377
|
execSync("git config core.fsmonitor false", { cwd: root, stdio: "ignore" })
|
|
378
378
|
execSync("git add -A", { cwd: root, stdio: "ignore" })
|
|
379
379
|
execSync('git -c user.name="e2e" -c user.email="e2e@example.com" commit -m "init" --allow-empty', {
|
|
@@ -2,7 +2,7 @@ import { test, expect } from "../fixtures"
|
|
|
2
2
|
import { serverNamePattern, serverUrls } from "../utils"
|
|
3
3
|
import { closeDialog, clickMenuItem } from "../actions"
|
|
4
4
|
|
|
5
|
-
const DEFAULT_SERVER_URL_KEY = "
|
|
5
|
+
const DEFAULT_SERVER_URL_KEY = "reigncode.settings.dat:defaultServerUrl"
|
|
6
6
|
|
|
7
7
|
test("can set a default server on web", async ({ page, gotoSession }) => {
|
|
8
8
|
await page.addInitScript((key: string) => {
|
package/e2e/fixtures.ts
CHANGED
|
@@ -141,9 +141,9 @@ async function seedStorage(page: Page, input: { directory: string; extra?: strin
|
|
|
141
141
|
},
|
|
142
142
|
}
|
|
143
143
|
localStorage.setItem(
|
|
144
|
-
"
|
|
144
|
+
"reigncode.global.dat:model",
|
|
145
145
|
JSON.stringify({
|
|
146
|
-
recent: [{ providerID: "
|
|
146
|
+
recent: [{ providerID: "reigncode", modelID: "big-pickle" }],
|
|
147
147
|
user: [],
|
|
148
148
|
variant: {},
|
|
149
149
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises"
|
|
2
2
|
import os from "node:os"
|
|
3
3
|
import path from "node:path"
|
|
4
|
-
import { base64Decode } from "
|
|
4
|
+
import { base64Decode } from "reigncode-util/encode"
|
|
5
5
|
import type { Page } from "@playwright/test"
|
|
6
6
|
|
|
7
7
|
import { test, expect } from "../fixtures"
|
|
@@ -110,7 +110,7 @@ test("can create a workspace", async ({ page, withProject }) => {
|
|
|
110
110
|
test("non-git projects keep workspace mode disabled", async ({ page, withProject }) => {
|
|
111
111
|
await page.setViewportSize({ width: 1400, height: 800 })
|
|
112
112
|
|
|
113
|
-
const nonGit = await fs.mkdtemp(path.join(os.tmpdir(), "
|
|
113
|
+
const nonGit = await fs.mkdtemp(path.join(os.tmpdir(), "reigncode-e2e-project-nongit-"))
|
|
114
114
|
const nonGitSlug = dirSlug(nonGit)
|
|
115
115
|
|
|
116
116
|
await fs.writeFile(path.join(nonGit, "README.md"), "# e2e nongit\n")
|
|
@@ -122,7 +122,7 @@ test("non-git projects keep workspace mode disabled", async ({ page, withProject
|
|
|
122
122
|
await expect.poll(() => slugFromUrl(page.url()), { timeout: 30_000 }).not.toBe("")
|
|
123
123
|
|
|
124
124
|
const activeDir = await resolveSlug(slugFromUrl(page.url())).then((item) => item.directory)
|
|
125
|
-
expect(path.basename(activeDir)).toContain("
|
|
125
|
+
expect(path.basename(activeDir)).toContain("reigncode-e2e-project-nongit-")
|
|
126
126
|
|
|
127
127
|
await openSidebar(page)
|
|
128
128
|
await expect(page.getByRole("button", { name: "New workspace" })).toHaveCount(0)
|
|
@@ -7,7 +7,7 @@ test("dropping text/plain file: uri inserts a file pill", async ({ page, gotoSes
|
|
|
7
7
|
const prompt = page.locator(promptSelector)
|
|
8
8
|
await prompt.click()
|
|
9
9
|
|
|
10
|
-
const path = process.platform === "win32" ? "C:\\
|
|
10
|
+
const path = process.platform === "win32" ? "C:\\reigncode-e2e-drop.txt" : "/tmp/reigncode-e2e-drop.txt"
|
|
11
11
|
const dt = await page.evaluateHandle((text) => {
|
|
12
12
|
const dt = new DataTransfer()
|
|
13
13
|
dt.setData("text/plain", text)
|
package/e2e/selectors.ts
CHANGED
|
@@ -45,7 +45,7 @@ export const projectClearNotificationsSelector = (slug: string) =>
|
|
|
45
45
|
export const projectWorkspacesToggleSelector = (slug: string) =>
|
|
46
46
|
`[data-action="project-workspaces-toggle"][data-project="${slug}"]`
|
|
47
47
|
|
|
48
|
-
export const titlebarRightSelector = "#
|
|
48
|
+
export const titlebarRightSelector = "#reigncode-titlebar-right"
|
|
49
49
|
|
|
50
50
|
export const popoverBodySelector = '[data-slot="popover-body"]'
|
|
51
51
|
|
|
@@ -313,7 +313,7 @@ test("blocked permission flow supports allow once", async ({ page, sdk, gotoSess
|
|
|
313
313
|
id: "per_e2e_once",
|
|
314
314
|
sessionID: session.id,
|
|
315
315
|
permission: "bash",
|
|
316
|
-
patterns: ["/tmp/
|
|
316
|
+
patterns: ["/tmp/reigncode-e2e-perm-once"],
|
|
317
317
|
metadata: { description: "Need permission for command" },
|
|
318
318
|
},
|
|
319
319
|
undefined,
|
|
@@ -340,7 +340,7 @@ test("blocked permission flow supports reject", async ({ page, sdk, gotoSession
|
|
|
340
340
|
id: "per_e2e_reject",
|
|
341
341
|
sessionID: session.id,
|
|
342
342
|
permission: "bash",
|
|
343
|
-
patterns: ["/tmp/
|
|
343
|
+
patterns: ["/tmp/reigncode-e2e-perm-reject"],
|
|
344
344
|
},
|
|
345
345
|
undefined,
|
|
346
346
|
async (state) => {
|
|
@@ -366,7 +366,7 @@ test("blocked permission flow supports allow always", async ({ page, sdk, gotoSe
|
|
|
366
366
|
id: "per_e2e_always",
|
|
367
367
|
sessionID: session.id,
|
|
368
368
|
permission: "bash",
|
|
369
|
-
patterns: ["/tmp/
|
|
369
|
+
patterns: ["/tmp/reigncode-e2e-perm-always"],
|
|
370
370
|
metadata: { description: "Need permission for command" },
|
|
371
371
|
},
|
|
372
372
|
undefined,
|
|
@@ -453,7 +453,7 @@ test("child session permission request blocks parent dock and supports allow onc
|
|
|
453
453
|
id: "per_e2e_child",
|
|
454
454
|
sessionID: child.id,
|
|
455
455
|
permission: "bash",
|
|
456
|
-
patterns: ["/tmp/
|
|
456
|
+
patterns: ["/tmp/reigncode-e2e-perm-child"],
|
|
457
457
|
metadata: { description: "Need child permission" },
|
|
458
458
|
},
|
|
459
459
|
{ child },
|
|
@@ -29,7 +29,7 @@ test("smoke settings dialog opens, switches tabs, closes", async ({ page, gotoSe
|
|
|
29
29
|
|
|
30
30
|
test("changing language updates settings labels", async ({ page, gotoSession }) => {
|
|
31
31
|
await page.addInitScript(() => {
|
|
32
|
-
localStorage.setItem("
|
|
32
|
+
localStorage.setItem("reigncode.global.dat:language", JSON.stringify({ locale: "en" }))
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
await gotoSession()
|
|
@@ -104,7 +104,7 @@ test("changing theme persists in localStorage", async ({ page, gotoSession }) =>
|
|
|
104
104
|
await page.keyboard.press("Escape")
|
|
105
105
|
|
|
106
106
|
const storedThemeId = await page.evaluate(() => {
|
|
107
|
-
return localStorage.getItem("
|
|
107
|
+
return localStorage.getItem("reigncode-theme-id")
|
|
108
108
|
})
|
|
109
109
|
|
|
110
110
|
expect(storedThemeId).not.toBeNull()
|
|
@@ -118,9 +118,9 @@ test("changing theme persists in localStorage", async ({ page, gotoSession }) =>
|
|
|
118
118
|
|
|
119
119
|
test("legacy oc-1 theme migrates to oc-2", async ({ page, gotoSession }) => {
|
|
120
120
|
await page.addInitScript(() => {
|
|
121
|
-
localStorage.setItem("
|
|
122
|
-
localStorage.setItem("
|
|
123
|
-
localStorage.setItem("
|
|
121
|
+
localStorage.setItem("reigncode-theme-id", "oc-1")
|
|
122
|
+
localStorage.setItem("reigncode-theme-css-light", "--background-base:#fff;")
|
|
123
|
+
localStorage.setItem("reigncode-theme-css-dark", "--background-base:#000;")
|
|
124
124
|
})
|
|
125
125
|
|
|
126
126
|
await gotoSession()
|
|
@@ -130,7 +130,7 @@ test("legacy oc-1 theme migrates to oc-2", async ({ page, gotoSession }) => {
|
|
|
130
130
|
await expect
|
|
131
131
|
.poll(async () => {
|
|
132
132
|
return await page.evaluate(() => {
|
|
133
|
-
return localStorage.getItem("
|
|
133
|
+
return localStorage.getItem("reigncode-theme-id")
|
|
134
134
|
})
|
|
135
135
|
})
|
|
136
136
|
.toBe("oc-2")
|
|
@@ -138,7 +138,7 @@ test("legacy oc-1 theme migrates to oc-2", async ({ page, gotoSession }) => {
|
|
|
138
138
|
await expect
|
|
139
139
|
.poll(async () => {
|
|
140
140
|
return await page.evaluate(() => {
|
|
141
|
-
return localStorage.getItem("
|
|
141
|
+
return localStorage.getItem("reigncode-theme-css-light")
|
|
142
142
|
})
|
|
143
143
|
})
|
|
144
144
|
.toBeNull()
|
|
@@ -146,7 +146,7 @@ test("legacy oc-1 theme migrates to oc-2", async ({ page, gotoSession }) => {
|
|
|
146
146
|
await expect
|
|
147
147
|
.poll(async () => {
|
|
148
148
|
return await page.evaluate(() => {
|
|
149
|
-
return localStorage.getItem("
|
|
149
|
+
return localStorage.getItem("reigncode-theme-css-dark")
|
|
150
150
|
})
|
|
151
151
|
})
|
|
152
152
|
.toBeNull()
|
|
@@ -32,7 +32,7 @@ test("sidebar collapsed state persists across navigation and reload", async ({ p
|
|
|
32
32
|
await expect(button).toHaveAttribute("aria-expanded", "false")
|
|
33
33
|
|
|
34
34
|
const opened = await page.evaluate(
|
|
35
|
-
() => JSON.parse(localStorage.getItem("
|
|
35
|
+
() => JSON.parse(localStorage.getItem("reigncode.global.dat:layout") ?? "{}").sidebar?.opened,
|
|
36
36
|
)
|
|
37
37
|
await expect(opened).toBe(false)
|
|
38
38
|
})
|
package/e2e/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createOpencodeClient } from "
|
|
2
|
-
import { base64Encode, checksum } from "
|
|
1
|
+
import { createOpencodeClient } from "reigncode-sdk/v2/client"
|
|
2
|
+
import { base64Encode, checksum } from "reigncode-util/encode"
|
|
3
3
|
|
|
4
4
|
export const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "127.0.0.1"
|
|
5
5
|
export const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096"
|
|
@@ -59,5 +59,5 @@ export function sessionPath(directory: string, sessionID?: string) {
|
|
|
59
59
|
export function workspacePersistKey(directory: string, key: string) {
|
|
60
60
|
const head = (directory.slice(0, 12) || "workspace").replace(/[^a-zA-Z0-9._-]/g, "-")
|
|
61
61
|
const sum = checksum(directory) ?? "0"
|
|
62
|
-
return `
|
|
62
|
+
return `reigncode.workspace.${head}.${sum}.dat:workspace:${key}`
|
|
63
63
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reigncode-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
".":
|
|
8
|
-
"import": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts"
|
|
10
|
-
},
|
|
7
|
+
".": "./src/index.ts",
|
|
11
8
|
"./vite": "./vite.js",
|
|
12
9
|
"./index.css": "./src/index.css"
|
|
13
10
|
},
|
|
@@ -42,6 +39,9 @@
|
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
44
41
|
"@kobalte/core": "catalog:",
|
|
42
|
+
"reigncode-sdk": "workspace:*",
|
|
43
|
+
"reigncode-ui": "workspace:*",
|
|
44
|
+
"reigncode-util": "workspace:*",
|
|
45
45
|
"@shikijs/transformers": "3.9.2",
|
|
46
46
|
"@solid-primitives/active-element": "2.1.3",
|
|
47
47
|
"@solid-primitives/audio": "1.4.2",
|
|
@@ -70,8 +70,6 @@
|
|
|
70
70
|
"solid-list": "catalog:",
|
|
71
71
|
"tailwindcss": "catalog:",
|
|
72
72
|
"virtua": "catalog:",
|
|
73
|
-
"zod": "catalog:"
|
|
74
|
-
"reigncode-sdk": "1.3.2",
|
|
75
|
-
"reign-ui": "1.3.2"
|
|
73
|
+
"zod": "catalog:"
|
|
76
74
|
}
|
|
77
|
-
}
|
|
75
|
+
}
|
package/script/e2e-local.ts
CHANGED
|
@@ -44,7 +44,7 @@ async function waitForHealth(url: string) {
|
|
|
44
44
|
|
|
45
45
|
const appDir = process.cwd()
|
|
46
46
|
const repoDir = path.resolve(appDir, "../..")
|
|
47
|
-
const opencodeDir = path.join(repoDir, "packages", "
|
|
47
|
+
const opencodeDir = path.join(repoDir, "packages", "reigncode")
|
|
48
48
|
|
|
49
49
|
const extraArgs = (() => {
|
|
50
50
|
const args = process.argv.slice(2)
|
|
@@ -54,7 +54,7 @@ const extraArgs = (() => {
|
|
|
54
54
|
|
|
55
55
|
const [serverPort, webPort] = await Promise.all([freePort(), freePort()])
|
|
56
56
|
|
|
57
|
-
const sandbox = await fs.mkdtemp(path.join(os.tmpdir(), "
|
|
57
|
+
const sandbox = await fs.mkdtemp(path.join(os.tmpdir(), "reigncode-e2e-"))
|
|
58
58
|
const keepSandbox = process.env.REIGNCODE_E2E_KEEP_SANDBOX === "1"
|
|
59
59
|
|
|
60
60
|
const serverEnv = {
|
|
@@ -71,7 +71,7 @@ const serverEnv = {
|
|
|
71
71
|
REIGNCODE_E2E_PROJECT_DIR: repoDir,
|
|
72
72
|
REIGNCODE_E2E_SESSION_TITLE: "E2E Session",
|
|
73
73
|
REIGNCODE_E2E_MESSAGE: "Seeded for UI e2e",
|
|
74
|
-
REIGNCODE_E2E_MODEL: "
|
|
74
|
+
REIGNCODE_E2E_MODEL: "reigncode/gpt-5-nano",
|
|
75
75
|
REIGNCODE_CLIENT: "app",
|
|
76
76
|
REIGNCODE_STRICT_CONFIG_DEPS: "true",
|
|
77
77
|
} satisfies Record<string, string>
|
|
@@ -145,21 +145,21 @@ try {
|
|
|
145
145
|
} else {
|
|
146
146
|
Object.assign(process.env, serverEnv)
|
|
147
147
|
process.env.AGENT = "1"
|
|
148
|
-
process.env.
|
|
148
|
+
process.env.REIGNCODE = "1"
|
|
149
149
|
process.env.REIGNCODE_PID = String(process.pid)
|
|
150
150
|
|
|
151
|
-
const log = await import("../../
|
|
152
|
-
const install = await import("../../
|
|
151
|
+
const log = await import("../../reigncode/src/util/log")
|
|
152
|
+
const install = await import("../../reigncode/src/installation")
|
|
153
153
|
await log.Log.init({
|
|
154
154
|
print: true,
|
|
155
155
|
dev: install.Installation.isLocal(),
|
|
156
156
|
level: "WARN",
|
|
157
157
|
})
|
|
158
158
|
|
|
159
|
-
const servermod = await import("../../
|
|
160
|
-
inst = await import("../../
|
|
159
|
+
const servermod = await import("../../reigncode/src/server/server")
|
|
160
|
+
inst = await import("../../reigncode/src/project/instance")
|
|
161
161
|
server = servermod.Server.listen({ port: serverPort, hostname: "127.0.0.1" })
|
|
162
|
-
console.log(`
|
|
162
|
+
console.log(`reigncode server listening on http://127.0.0.1:${serverPort}`)
|
|
163
163
|
|
|
164
164
|
await waitForHealth(`http://127.0.0.1:${serverPort}/global/health`)
|
|
165
165
|
runner = Bun.spawn(["bun", "test:e2e", ...extraArgs], {
|
package/src/app.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "@/index.css"
|
|
2
|
-
import { I18nProvider } from "
|
|
3
|
-
import { DialogProvider } from "
|
|
4
|
-
import { FileComponentProvider } from "
|
|
5
|
-
import { MarkedProvider } from "
|
|
6
|
-
import { File } from "
|
|
7
|
-
import { Font } from "
|
|
8
|
-
import { Splash } from "
|
|
9
|
-
import { ThemeProvider } from "
|
|
2
|
+
import { I18nProvider } from "reigncode-ui/context"
|
|
3
|
+
import { DialogProvider } from "reigncode-ui/context/dialog"
|
|
4
|
+
import { FileComponentProvider } from "reigncode-ui/context/file"
|
|
5
|
+
import { MarkedProvider } from "reigncode-ui/context/marked"
|
|
6
|
+
import { File } from "reigncode-ui/file"
|
|
7
|
+
import { Font } from "reigncode-ui/font"
|
|
8
|
+
import { Splash } from "reigncode-ui/logo"
|
|
9
|
+
import { ThemeProvider } from "reigncode-ui/theme"
|
|
10
10
|
import { MetaProvider } from "@solidjs/meta"
|
|
11
11
|
import { type BaseRouterProps, Navigate, Route, Router } from "@solidjs/router"
|
|
12
12
|
import { QueryClient, QueryClientProvider } from "@tanstack/solid-query"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useIsRouting, useLocation } from "@solidjs/router"
|
|
2
2
|
import { batch, createEffect, onCleanup, onMount } from "solid-js"
|
|
3
3
|
import { createStore } from "solid-js/store"
|
|
4
|
-
import { Tooltip } from "
|
|
4
|
+
import { Tooltip } from "reigncode-ui/tooltip"
|
|
5
5
|
import { useLanguage } from "@/context/language"
|
|
6
6
|
|
|
7
7
|
type Mem = Performance & {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { ProviderAuthAuthorization } from "
|
|
2
|
-
import { Button } from "
|
|
3
|
-
import { useDialog } from "
|
|
4
|
-
import { Dialog } from "
|
|
5
|
-
import { Icon } from "
|
|
6
|
-
import { IconButton } from "
|
|
7
|
-
import { List, type ListRef } from "
|
|
8
|
-
import { ProviderIcon } from "
|
|
9
|
-
import { Spinner } from "
|
|
10
|
-
import { TextField } from "
|
|
11
|
-
import { showToast } from "
|
|
1
|
+
import type { ProviderAuthAuthorization } from "reigncode-sdk/v2/client"
|
|
2
|
+
import { Button } from "reigncode-ui/button"
|
|
3
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
4
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
5
|
+
import { Icon } from "reigncode-ui/icon"
|
|
6
|
+
import { IconButton } from "reigncode-ui/icon-button"
|
|
7
|
+
import { List, type ListRef } from "reigncode-ui/list"
|
|
8
|
+
import { ProviderIcon } from "reigncode-ui/provider-icon"
|
|
9
|
+
import { Spinner } from "reigncode-ui/spinner"
|
|
10
|
+
import { TextField } from "reigncode-ui/text-field"
|
|
11
|
+
import { showToast } from "reigncode-ui/toast"
|
|
12
12
|
import { createMemo, Match, onCleanup, onMount, Switch } from "solid-js"
|
|
13
13
|
import { createStore, produce } from "solid-js/store"
|
|
14
14
|
import { Link } from "@/components/link"
|
|
@@ -393,7 +393,7 @@ export function DialogConnectProvider(props: { provider: string }) {
|
|
|
393
393
|
return (
|
|
394
394
|
<div class="flex flex-col gap-6">
|
|
395
395
|
<Switch>
|
|
396
|
-
<Match when={provider().id === "
|
|
396
|
+
<Match when={provider().id === "reigncode"}>
|
|
397
397
|
<div class="flex flex-col gap-4">
|
|
398
398
|
<div class="text-14-regular text-text-base">{language.t("provider.connect.opencodeZen.line1")}</div>
|
|
399
399
|
<div class="text-14-regular text-text-base">{language.t("provider.connect.opencodeZen.line2")}</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Button } from "
|
|
2
|
-
import { useDialog } from "
|
|
3
|
-
import { Dialog } from "
|
|
4
|
-
import { IconButton } from "
|
|
5
|
-
import { ProviderIcon } from "
|
|
1
|
+
import { Button } from "reigncode-ui/button"
|
|
2
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
3
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
4
|
+
import { IconButton } from "reigncode-ui/icon-button"
|
|
5
|
+
import { ProviderIcon } from "reigncode-ui/provider-icon"
|
|
6
6
|
import { useMutation } from "@tanstack/solid-query"
|
|
7
|
-
import { TextField } from "
|
|
8
|
-
import { showToast } from "
|
|
7
|
+
import { TextField } from "reigncode-ui/text-field"
|
|
8
|
+
import { showToast } from "reigncode-ui/toast"
|
|
9
9
|
import { batch, For } from "solid-js"
|
|
10
10
|
import { createStore, produce } from "solid-js/store"
|
|
11
11
|
import { Link } from "@/components/link"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Button } from "
|
|
2
|
-
import { useDialog } from "
|
|
3
|
-
import { Dialog } from "
|
|
4
|
-
import { TextField } from "
|
|
1
|
+
import { Button } from "reigncode-ui/button"
|
|
2
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
3
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
4
|
+
import { TextField } from "reigncode-ui/text-field"
|
|
5
5
|
import { useMutation } from "@tanstack/solid-query"
|
|
6
|
-
import { Icon } from "
|
|
6
|
+
import { Icon } from "reigncode-ui/icon"
|
|
7
7
|
import { createMemo, For, Show } from "solid-js"
|
|
8
8
|
import { createStore } from "solid-js/store"
|
|
9
9
|
import { useGlobalSDK } from "@/context/global-sdk"
|
|
10
10
|
import { useGlobalSync } from "@/context/global-sync"
|
|
11
11
|
import { type LocalProject, getAvatarColors } from "@/context/layout"
|
|
12
|
-
import { getFilename } from "
|
|
13
|
-
import { Avatar } from "
|
|
12
|
+
import { getFilename } from "reigncode-util/path"
|
|
13
|
+
import { Avatar } from "reigncode-ui/avatar"
|
|
14
14
|
import { useLanguage } from "@/context/language"
|
|
15
15
|
|
|
16
16
|
const AVATAR_COLOR_KEYS = ["pink", "mint", "orange", "purple", "cyan", "lime"] as const
|
|
@@ -3,13 +3,13 @@ import { useNavigate, useParams } from "@solidjs/router"
|
|
|
3
3
|
import { useSync } from "@/context/sync"
|
|
4
4
|
import { useSDK } from "@/context/sdk"
|
|
5
5
|
import { usePrompt } from "@/context/prompt"
|
|
6
|
-
import { useDialog } from "
|
|
7
|
-
import { Dialog } from "
|
|
8
|
-
import { List } from "
|
|
9
|
-
import { showToast } from "
|
|
6
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
7
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
8
|
+
import { List } from "reigncode-ui/list"
|
|
9
|
+
import { showToast } from "reigncode-ui/toast"
|
|
10
10
|
import { extractPromptFromParts } from "@/utils/prompt"
|
|
11
|
-
import type { TextPart as SDKTextPart } from "
|
|
12
|
-
import { base64Encode } from "
|
|
11
|
+
import type { TextPart as SDKTextPart } from "reigncode-sdk/v2/client"
|
|
12
|
+
import { base64Encode } from "reigncode-util/encode"
|
|
13
13
|
import { useLanguage } from "@/context/language"
|
|
14
14
|
|
|
15
15
|
interface ForkableMessage {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Dialog } from "
|
|
2
|
-
import { List } from "
|
|
3
|
-
import { Switch } from "
|
|
4
|
-
import { Tooltip } from "
|
|
5
|
-
import { Button } from "
|
|
1
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
2
|
+
import { List } from "reigncode-ui/list"
|
|
3
|
+
import { Switch } from "reigncode-ui/switch"
|
|
4
|
+
import { Tooltip } from "reigncode-ui/tooltip"
|
|
5
|
+
import { Button } from "reigncode-ui/button"
|
|
6
6
|
import type { Component } from "solid-js"
|
|
7
7
|
import { useLocal } from "@/context/local"
|
|
8
8
|
import { popularProviders } from "@/hooks/use-providers"
|
|
9
9
|
import { useLanguage } from "@/context/language"
|
|
10
|
-
import { useDialog } from "
|
|
10
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
11
11
|
import { DialogSelectProvider } from "./dialog-select-provider"
|
|
12
12
|
|
|
13
13
|
export const DialogManageModels: Component = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSignal } from "solid-js"
|
|
2
|
-
import { Dialog } from "
|
|
3
|
-
import { Button } from "
|
|
4
|
-
import { useDialog } from "
|
|
2
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
3
|
+
import { Button } from "reigncode-ui/button"
|
|
4
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
5
5
|
import { useLanguage } from "@/context/language"
|
|
6
6
|
import { useSettings } from "@/context/settings"
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useDialog } from "
|
|
2
|
-
import { Dialog } from "
|
|
3
|
-
import { FileIcon } from "
|
|
4
|
-
import { List } from "
|
|
5
|
-
import type { ListRef } from "
|
|
6
|
-
import { getDirectory, getFilename } from "
|
|
1
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
2
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
3
|
+
import { FileIcon } from "reigncode-ui/file-icon"
|
|
4
|
+
import { List } from "reigncode-ui/list"
|
|
5
|
+
import type { ListRef } from "reigncode-ui/list"
|
|
6
|
+
import { getDirectory, getFilename } from "reigncode-util/path"
|
|
7
7
|
import fuzzysort from "fuzzysort"
|
|
8
8
|
import { createMemo, createResource, createSignal } from "solid-js"
|
|
9
9
|
import { useGlobalSDK } from "@/context/global-sdk"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useDialog } from "
|
|
2
|
-
import { Dialog } from "
|
|
3
|
-
import { FileIcon } from "
|
|
4
|
-
import { Icon } from "
|
|
5
|
-
import { Keybind } from "
|
|
6
|
-
import { List } from "
|
|
7
|
-
import { base64Encode } from "
|
|
8
|
-
import { getDirectory, getFilename } from "
|
|
1
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
2
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
3
|
+
import { FileIcon } from "reigncode-ui/file-icon"
|
|
4
|
+
import { Icon } from "reigncode-ui/icon"
|
|
5
|
+
import { Keybind } from "reigncode-ui/keybind"
|
|
6
|
+
import { List } from "reigncode-ui/list"
|
|
7
|
+
import { base64Encode } from "reigncode-util/encode"
|
|
8
|
+
import { getDirectory, getFilename } from "reigncode-util/path"
|
|
9
9
|
import { useNavigate } from "@solidjs/router"
|
|
10
10
|
import { createMemo, createSignal, Match, onCleanup, Show, Switch } from "solid-js"
|
|
11
11
|
import { formatKeybind, useCommand, type CommandOption } from "@/context/command"
|
|
@@ -2,9 +2,9 @@ import { useMutation } from "@tanstack/solid-query"
|
|
|
2
2
|
import { Component, createMemo, Show } from "solid-js"
|
|
3
3
|
import { useSync } from "@/context/sync"
|
|
4
4
|
import { useSDK } from "@/context/sdk"
|
|
5
|
-
import { Dialog } from "
|
|
6
|
-
import { List } from "
|
|
7
|
-
import { Switch } from "
|
|
5
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
6
|
+
import { List } from "reigncode-ui/list"
|
|
7
|
+
import { Switch } from "reigncode-ui/switch"
|
|
8
8
|
import { useLanguage } from "@/context/language"
|
|
9
9
|
|
|
10
10
|
const statusLabels = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Button } from "
|
|
2
|
-
import { useDialog } from "
|
|
3
|
-
import { Dialog } from "
|
|
4
|
-
import { List, type ListRef } from "
|
|
5
|
-
import { ProviderIcon } from "
|
|
6
|
-
import { Tag } from "
|
|
7
|
-
import { Tooltip } from "
|
|
1
|
+
import { Button } from "reigncode-ui/button"
|
|
2
|
+
import { useDialog } from "reigncode-ui/context/dialog"
|
|
3
|
+
import { Dialog } from "reigncode-ui/dialog"
|
|
4
|
+
import { List, type ListRef } from "reigncode-ui/list"
|
|
5
|
+
import { ProviderIcon } from "reigncode-ui/provider-icon"
|
|
6
|
+
import { Tag } from "reigncode-ui/tag"
|
|
7
|
+
import { Tooltip } from "reigncode-ui/tooltip"
|
|
8
8
|
import { type Component, Show } from "solid-js"
|
|
9
9
|
import { useLocal } from "@/context/local"
|
|
10
10
|
import { popularProviders, useProviders } from "@/hooks/use-providers"
|
|
@@ -49,7 +49,7 @@ export const DialogSelectModelUnpaid: Component<{ model?: ModelState }> = (props
|
|
|
49
49
|
<ModelTooltip
|
|
50
50
|
model={item}
|
|
51
51
|
latest={item.latest}
|
|
52
|
-
free={item.provider.id === "
|
|
52
|
+
free={item.provider.id === "reigncode" && (!item.cost || item.cost.input === 0)}
|
|
53
53
|
/>
|
|
54
54
|
}
|
|
55
55
|
>
|
|
@@ -98,13 +98,13 @@ export const DialogSelectModelUnpaid: Component<{ model?: ModelState }> = (props
|
|
|
98
98
|
<div class="w-full flex items-center gap-x-3">
|
|
99
99
|
<ProviderIcon data-slot="list-item-extra-icon" id={i.id} />
|
|
100
100
|
<span>{i.name}</span>
|
|
101
|
-
<Show when={i.id === "
|
|
102
|
-
<div class="text-14-regular text-text-weak">{language.t("dialog.provider.
|
|
101
|
+
<Show when={i.id === "reigncode"}>
|
|
102
|
+
<div class="text-14-regular text-text-weak">{language.t("dialog.provider.reigncode.tagline")}</div>
|
|
103
103
|
</Show>
|
|
104
|
-
<Show when={i.id === "
|
|
104
|
+
<Show when={i.id === "reigncode"}>
|
|
105
105
|
<Tag>{language.t("dialog.provider.tag.recommended")}</Tag>
|
|
106
106
|
</Show>
|
|
107
|
-
<Show when={i.id === "
|
|
107
|
+
<Show when={i.id === "reigncode-go"}>
|
|
108
108
|
<>
|
|
109
109
|
<div class="text-14-regular text-text-weak">
|
|
110
110
|
{language.t("dialog.provider.opencodeGo.tagline")}
|