@jonsoc/app 1.1.34
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 +30 -0
- package/README.md +51 -0
- package/bunfig.toml +2 -0
- package/e2e/context.spec.ts +45 -0
- package/e2e/file-open.spec.ts +23 -0
- package/e2e/file-viewer.spec.ts +35 -0
- package/e2e/fixtures.ts +40 -0
- package/e2e/home.spec.ts +21 -0
- package/e2e/model-picker.spec.ts +43 -0
- package/e2e/navigation.spec.ts +9 -0
- package/e2e/palette.spec.ts +15 -0
- package/e2e/prompt-mention.spec.ts +26 -0
- package/e2e/prompt-slash-open.spec.ts +22 -0
- package/e2e/prompt.spec.ts +62 -0
- package/e2e/session.spec.ts +21 -0
- package/e2e/settings.spec.ts +44 -0
- package/e2e/sidebar.spec.ts +21 -0
- package/e2e/terminal-init.spec.ts +25 -0
- package/e2e/terminal.spec.ts +16 -0
- package/e2e/tsconfig.json +8 -0
- package/e2e/utils.ts +38 -0
- package/happydom.ts +75 -0
- package/index.html +23 -0
- package/package.json +72 -0
- package/playwright.config.ts +43 -0
- package/public/_headers +17 -0
- package/public/apple-touch-icon-v3.png +1 -0
- package/public/apple-touch-icon.png +1 -0
- package/public/favicon-96x96-v3.png +1 -0
- package/public/favicon-96x96.png +1 -0
- package/public/favicon-v3.ico +1 -0
- package/public/favicon-v3.svg +1 -0
- package/public/favicon.ico +1 -0
- package/public/favicon.svg +1 -0
- package/public/oc-theme-preload.js +28 -0
- package/public/site.webmanifest +1 -0
- package/public/social-share-zen.png +1 -0
- package/public/social-share.png +1 -0
- package/public/web-app-manifest-192x192.png +1 -0
- package/public/web-app-manifest-512x512.png +1 -0
- package/script/e2e-local.ts +143 -0
- package/src/addons/serialize.test.ts +319 -0
- package/src/addons/serialize.ts +591 -0
- package/src/app.tsx +150 -0
- package/src/components/dialog-connect-provider.tsx +428 -0
- package/src/components/dialog-edit-project.tsx +259 -0
- package/src/components/dialog-fork.tsx +104 -0
- package/src/components/dialog-manage-models.tsx +59 -0
- package/src/components/dialog-select-directory.tsx +208 -0
- package/src/components/dialog-select-file.tsx +196 -0
- package/src/components/dialog-select-mcp.tsx +96 -0
- package/src/components/dialog-select-model-unpaid.tsx +130 -0
- package/src/components/dialog-select-model.tsx +162 -0
- package/src/components/dialog-select-provider.tsx +70 -0
- package/src/components/dialog-select-server.tsx +249 -0
- package/src/components/dialog-settings.tsx +112 -0
- package/src/components/file-tree.tsx +112 -0
- package/src/components/link.tsx +17 -0
- package/src/components/model-tooltip.tsx +91 -0
- package/src/components/prompt-input.tsx +2076 -0
- package/src/components/session/index.ts +5 -0
- package/src/components/session/session-context-tab.tsx +428 -0
- package/src/components/session/session-header.tsx +343 -0
- package/src/components/session/session-new-view.tsx +93 -0
- package/src/components/session/session-sortable-tab.tsx +56 -0
- package/src/components/session/session-sortable-terminal-tab.tsx +187 -0
- package/src/components/session-context-usage.tsx +113 -0
- package/src/components/session-lsp-indicator.tsx +42 -0
- package/src/components/session-mcp-indicator.tsx +34 -0
- package/src/components/settings-agents.tsx +15 -0
- package/src/components/settings-commands.tsx +15 -0
- package/src/components/settings-general.tsx +306 -0
- package/src/components/settings-keybinds.tsx +437 -0
- package/src/components/settings-mcp.tsx +15 -0
- package/src/components/settings-models.tsx +15 -0
- package/src/components/settings-permissions.tsx +234 -0
- package/src/components/settings-providers.tsx +15 -0
- package/src/components/terminal.tsx +315 -0
- package/src/components/titlebar.tsx +156 -0
- package/src/context/command.tsx +308 -0
- package/src/context/comments.tsx +140 -0
- package/src/context/file.tsx +409 -0
- package/src/context/global-sdk.tsx +106 -0
- package/src/context/global-sync.tsx +898 -0
- package/src/context/language.tsx +161 -0
- package/src/context/layout-scroll.test.ts +73 -0
- package/src/context/layout-scroll.ts +118 -0
- package/src/context/layout.tsx +648 -0
- package/src/context/local.tsx +578 -0
- package/src/context/notification.tsx +173 -0
- package/src/context/permission.tsx +167 -0
- package/src/context/platform.tsx +59 -0
- package/src/context/prompt.tsx +245 -0
- package/src/context/sdk.tsx +48 -0
- package/src/context/server.tsx +214 -0
- package/src/context/settings.tsx +166 -0
- package/src/context/sync.tsx +320 -0
- package/src/context/terminal.tsx +267 -0
- package/src/custom-elements.d.ts +17 -0
- package/src/entry.tsx +76 -0
- package/src/env.d.ts +8 -0
- package/src/hooks/use-providers.ts +31 -0
- package/src/i18n/ar.ts +656 -0
- package/src/i18n/br.ts +667 -0
- package/src/i18n/da.ts +582 -0
- package/src/i18n/de.ts +591 -0
- package/src/i18n/en.ts +665 -0
- package/src/i18n/es.ts +585 -0
- package/src/i18n/fr.ts +592 -0
- package/src/i18n/ja.ts +579 -0
- package/src/i18n/ko.ts +580 -0
- package/src/i18n/no.ts +602 -0
- package/src/i18n/pl.ts +661 -0
- package/src/i18n/ru.ts +664 -0
- package/src/i18n/zh.ts +574 -0
- package/src/i18n/zht.ts +570 -0
- package/src/index.css +57 -0
- package/src/index.ts +2 -0
- package/src/pages/directory-layout.tsx +57 -0
- package/src/pages/error.tsx +290 -0
- package/src/pages/home.tsx +125 -0
- package/src/pages/layout.tsx +2599 -0
- package/src/pages/session.tsx +2505 -0
- package/src/sst-env.d.ts +10 -0
- package/src/utils/dom.ts +51 -0
- package/src/utils/id.ts +99 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/perf.ts +135 -0
- package/src/utils/persist.ts +377 -0
- package/src/utils/prompt.ts +203 -0
- package/src/utils/same.ts +6 -0
- package/src/utils/solid-dnd.tsx +55 -0
- package/src/utils/sound.ts +110 -0
- package/src/utils/speech.ts +302 -0
- package/src/utils/worktree.ts +58 -0
- package/sst-env.d.ts +9 -0
- package/tsconfig.json +26 -0
- package/vite.config.ts +15 -0
- package/vite.js +26 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const normalize = (directory: string) => directory.replace(/[\\/]+$/, "")
|
|
2
|
+
|
|
3
|
+
type State =
|
|
4
|
+
| {
|
|
5
|
+
status: "pending"
|
|
6
|
+
}
|
|
7
|
+
| {
|
|
8
|
+
status: "ready"
|
|
9
|
+
}
|
|
10
|
+
| {
|
|
11
|
+
status: "failed"
|
|
12
|
+
message: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const state = new Map<string, State>()
|
|
16
|
+
const waiters = new Map<string, Array<(state: State) => void>>()
|
|
17
|
+
|
|
18
|
+
export const Worktree = {
|
|
19
|
+
get(directory: string) {
|
|
20
|
+
return state.get(normalize(directory))
|
|
21
|
+
},
|
|
22
|
+
pending(directory: string) {
|
|
23
|
+
const key = normalize(directory)
|
|
24
|
+
const current = state.get(key)
|
|
25
|
+
if (current && current.status !== "pending") return
|
|
26
|
+
state.set(key, { status: "pending" })
|
|
27
|
+
},
|
|
28
|
+
ready(directory: string) {
|
|
29
|
+
const key = normalize(directory)
|
|
30
|
+
state.set(key, { status: "ready" })
|
|
31
|
+
const list = waiters.get(key)
|
|
32
|
+
if (!list) return
|
|
33
|
+
waiters.delete(key)
|
|
34
|
+
for (const fn of list) fn({ status: "ready" })
|
|
35
|
+
},
|
|
36
|
+
failed(directory: string, message: string) {
|
|
37
|
+
const key = normalize(directory)
|
|
38
|
+
state.set(key, { status: "failed", message })
|
|
39
|
+
const list = waiters.get(key)
|
|
40
|
+
if (!list) return
|
|
41
|
+
waiters.delete(key)
|
|
42
|
+
for (const fn of list) fn({ status: "failed", message })
|
|
43
|
+
},
|
|
44
|
+
wait(directory: string) {
|
|
45
|
+
const key = normalize(directory)
|
|
46
|
+
const current = state.get(key)
|
|
47
|
+
if (current && current.status !== "pending") return Promise.resolve(current)
|
|
48
|
+
|
|
49
|
+
return new Promise<State>((resolve) => {
|
|
50
|
+
const list = waiters.get(key)
|
|
51
|
+
if (!list) {
|
|
52
|
+
waiters.set(key, [resolve])
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
list.push(resolve)
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
}
|
package/sst-env.d.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"jsx": "preserve",
|
|
12
|
+
"jsxImportSource": "solid-js",
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"strict": true,
|
|
16
|
+
"noEmit": false,
|
|
17
|
+
"emitDeclarationOnly": true,
|
|
18
|
+
"outDir": "node_modules/.ts-dist",
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"paths": {
|
|
21
|
+
"@/*": ["./src/*"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"include": ["src", "package.json"],
|
|
25
|
+
"exclude": ["dist", "ts-dist"]
|
|
26
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "vite"
|
|
2
|
+
import desktopPlugin from "./vite"
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [desktopPlugin] as any,
|
|
6
|
+
server: {
|
|
7
|
+
host: "0.0.0.0",
|
|
8
|
+
allowedHosts: true,
|
|
9
|
+
port: 3000,
|
|
10
|
+
},
|
|
11
|
+
build: {
|
|
12
|
+
target: "esnext",
|
|
13
|
+
// sourcemap: true,
|
|
14
|
+
},
|
|
15
|
+
})
|
package/vite.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import solidPlugin from "vite-plugin-solid"
|
|
2
|
+
import tailwindcss from "@tailwindcss/vite"
|
|
3
|
+
import { fileURLToPath } from "url"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @type {import("vite").PluginOption}
|
|
7
|
+
*/
|
|
8
|
+
export default [
|
|
9
|
+
{
|
|
10
|
+
name: "opencode-desktop:config",
|
|
11
|
+
config() {
|
|
12
|
+
return {
|
|
13
|
+
resolve: {
|
|
14
|
+
alias: {
|
|
15
|
+
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
worker: {
|
|
19
|
+
format: "es",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
tailwindcss(),
|
|
25
|
+
solidPlugin(),
|
|
26
|
+
]
|