@useavalon/caelence-agent 0.2.1-canary.0 → 0.2.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 (71) hide show
  1. package/README.md +8 -5
  2. package/desktop/README.md +26 -0
  3. package/desktop/bun.lock +321 -0
  4. package/desktop/index.html +20 -0
  5. package/desktop/package.json +28 -0
  6. package/desktop/scripts/make-icons.ts +105 -0
  7. package/desktop/scripts/run-tauri.ts +40 -0
  8. package/desktop/src/App.tsx +2657 -0
  9. package/desktop/src/ComposerAttach.tsx +111 -0
  10. package/desktop/src/FloatNotice.test.ts +23 -0
  11. package/desktop/src/FloatNotice.tsx +30 -0
  12. package/desktop/src/LogoMark.tsx +37 -0
  13. package/desktop/src/SkillsPanel.tsx +409 -0
  14. package/desktop/src/api.ts +503 -0
  15. package/desktop/src/app.css +1749 -0
  16. package/desktop/src/composer-files.test.ts +46 -0
  17. package/desktop/src/composer-files.ts +135 -0
  18. package/desktop/src/dictation.test.ts +22 -0
  19. package/desktop/src/dictation.ts +59 -0
  20. package/desktop/src/integration-search.test.ts +13 -0
  21. package/desktop/src/integration-search.ts +8 -0
  22. package/desktop/src/main.tsx +43 -0
  23. package/desktop/src/picker-nav.test.ts +27 -0
  24. package/desktop/src/picker-nav.ts +26 -0
  25. package/desktop/src/queue.test.ts +37 -0
  26. package/desktop/src/queue.ts +40 -0
  27. package/desktop/src/rich-text.test.ts +85 -0
  28. package/desktop/src/rich-text.ts +193 -0
  29. package/desktop/src/session-menu.test.ts +19 -0
  30. package/desktop/src/session-menu.ts +12 -0
  31. package/desktop/src/skill-search.test.ts +37 -0
  32. package/desktop/src/skill-search.ts +25 -0
  33. package/desktop/src/stream.test.ts +93 -0
  34. package/desktop/src/stream.ts +197 -0
  35. package/desktop/src/styles/fonts/chivo-mono-latin-ext-wght-normal.woff2 +0 -0
  36. package/desktop/src/styles/fonts/chivo-mono-latin-wght-normal.ttf +0 -0
  37. package/desktop/src/styles/fonts/chivo-mono-latin-wght-normal.woff2 +0 -0
  38. package/desktop/src/styles/fonts/instrument-sans-latin-ext-wght-normal.woff2 +0 -0
  39. package/desktop/src/styles/fonts/instrument-sans-latin-wght-normal.ttf +0 -0
  40. package/desktop/src/styles/fonts/instrument-sans-latin-wght-normal.woff2 +0 -0
  41. package/desktop/src/styles/fonts.css +53 -0
  42. package/desktop/src/styles/primitives.css +600 -0
  43. package/desktop/src/styles/tokens-matte.css +354 -0
  44. package/desktop/src/thought.test.ts +96 -0
  45. package/desktop/src/thought.ts +87 -0
  46. package/desktop/src/tool-label.test.ts +17 -0
  47. package/desktop/src/tool-label.ts +70 -0
  48. package/desktop/src/vite-env.d.ts +15 -0
  49. package/desktop/src-tauri/Cargo.lock +4791 -0
  50. package/desktop/src-tauri/Cargo.toml +21 -0
  51. package/desktop/src-tauri/Entitlements.plist +8 -0
  52. package/desktop/src-tauri/Info.plist +12 -0
  53. package/desktop/src-tauri/build.rs +16 -0
  54. package/desktop/src-tauri/capabilities/default.json +15 -0
  55. package/desktop/src-tauri/icons/128x128.png +0 -0
  56. package/desktop/src-tauri/icons/16x16.png +0 -0
  57. package/desktop/src-tauri/icons/32x32.png +0 -0
  58. package/desktop/src-tauri/icons/henry.w@example.net +0 -0
  59. package/desktop/src-tauri/icons/icon.icns +0 -0
  60. package/desktop/src-tauri/icons/icon.ico +0 -0
  61. package/desktop/src-tauri/icons/icon.png +0 -0
  62. package/desktop/src-tauri/icons/icon.svg +7 -0
  63. package/desktop/src-tauri/permissions/bridge.toml +24 -0
  64. package/desktop/src-tauri/src/main.rs +312 -0
  65. package/desktop/src-tauri/src/mic.rs +216 -0
  66. package/desktop/src-tauri/tauri.conf.json +46 -0
  67. package/desktop/tsconfig.json +21 -0
  68. package/desktop/vite.config.ts +18 -0
  69. package/package.json +5 -4
  70. package/src/cli/main.test.ts +6 -0
  71. package/src/cli/main.ts +5 -2
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://schema.tauri.app/config/2",
3
+ "productName": "Caelence agent",
4
+ "version": "0.1.0",
5
+ "identifier": "studio.caelence.harness",
6
+ "build": {
7
+ "beforeDevCommand": "bun run dev",
8
+ "devUrl": "http://localhost:1420",
9
+ "beforeBuildCommand": "bun run build",
10
+ "frontendDist": "../dist"
11
+ },
12
+ "app": {
13
+ "windows": [
14
+ {
15
+ "label": "main",
16
+ "title": "Caelence agent",
17
+ "width": 960,
18
+ "height": 720,
19
+ "minWidth": 720,
20
+ "minHeight": 520
21
+ }
22
+ ],
23
+ "security": {
24
+ "csp": null,
25
+ "headers": {
26
+ "Permissions-Policy": "microphone=(self)"
27
+ }
28
+ }
29
+ },
30
+ "bundle": {
31
+ "active": true,
32
+ "targets": "all",
33
+ "macOS": {
34
+ "entitlements": "Entitlements.plist"
35
+ },
36
+ "icon": [
37
+ "icons/icon.png",
38
+ "icons/16x16.png",
39
+ "icons/32x32.png",
40
+ "icons/128x128.png",
41
+ "icons/henry.w@example.net",
42
+ "icons/icon.icns",
43
+ "icons/icon.ico"
44
+ ]
45
+ }
46
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": false,
10
+ "isolatedModules": true,
11
+ "moduleDetection": "force",
12
+ "noEmit": true,
13
+ "jsx": "react-jsx",
14
+ "strict": true,
15
+ "noUncheckedIndexedAccess": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true
18
+ },
19
+ "include": ["src", "../src/cli/slash.ts"],
20
+ "exclude": ["src/**/*.test.ts"]
21
+ }
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from "vite";
2
+ import react from "@vitejs/plugin-react";
3
+
4
+ const host = process.env.TAURI_DEV_HOST;
5
+
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ clearScreen: false,
9
+ server: {
10
+ port: 1420,
11
+ strictPort: true,
12
+ host: host || false,
13
+ hmr: host ? { protocol: "ws", host, port: 1421 } : undefined,
14
+ watch: {
15
+ ignored: ["**/.toolchain/**", "**/src-tauri/**", "**/dist/**"],
16
+ },
17
+ },
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useavalon/caelence-agent",
3
- "version": "0.2.1-canary.0",
3
+ "version": "0.2.1",
4
4
  "description": "Caelence agent: Strands turn loop, local tools, skills, evals, and a themable terminal UI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -20,9 +20,9 @@
20
20
  "bun": ">=1.2.0"
21
21
  },
22
22
  "bin": {
23
- "harness": "./bin/harness.ts",
24
23
  "caelence": "./bin/harness.ts",
25
- "caelence-agent": "./bin/harness.ts"
24
+ "caelence-agent": "./bin/harness.ts",
25
+ "harness": "./bin/harness.ts"
26
26
  },
27
27
  "exports": {
28
28
  ".": "./src/index.ts",
@@ -34,6 +34,7 @@
34
34
  "src",
35
35
  "skills",
36
36
  "brand",
37
+ "desktop",
37
38
  "README.md"
38
39
  ],
39
40
  "scripts": {
@@ -44,7 +45,7 @@
44
45
  "format": "biome format --write .",
45
46
  "check": "biome check --write .",
46
47
  "check:exports": "node scripts/check-exports.mjs",
47
- "prepare": "husky",
48
+ "prepare": "[ -d .git ] && husky || true",
48
49
  "prepublishOnly": "bun run typecheck && bun run test && bun run check:exports",
49
50
  "desktop": "bun src/cli/main.ts desktop"
50
51
  },
@@ -1,4 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
+ import { existsSync } from "node:fs";
3
+ import { resolve } from "node:path";
2
4
  import { parseCliArgs } from "./main.ts";
3
5
 
4
6
  describe("parseCliArgs", () => {
@@ -27,6 +29,10 @@ describe("parseCliArgs", () => {
27
29
  expect(parsed.cwd).toContain("proj");
28
30
  });
29
31
 
32
+ test("desktop app files sit next to src", () => {
33
+ expect(existsSync(resolve(import.meta.dir, "../../desktop/package.json"))).toBe(true);
34
+ });
35
+
30
36
  test("reads --mode", () => {
31
37
  const parsed = parseCliArgs(["--mode", "ask", "chat", "-m", "hello"]);
32
38
  expect(parsed.cmd).toBe("chat");
package/src/cli/main.ts CHANGED
@@ -129,7 +129,8 @@ function desktopToolchainEnv(desktopDir: string, cwd: string): NodeJS.ProcessEnv
129
129
  } else if (existsSync(resolve(systemCargoBin, "cargo"))) {
130
130
  pathDirs.unshift(systemCargoBin);
131
131
  }
132
- env.PATH = pathDirs.join(":");
132
+ const inherited = process.env.PATH ?? "";
133
+ env.PATH = [...pathDirs, inherited].filter(Boolean).join(":");
133
134
  return env;
134
135
  }
135
136
 
@@ -197,7 +198,9 @@ function agentCwd(parsed: ParsedCli): string {
197
198
  async function runDesktop(cwd: string): Promise<number> {
198
199
  const desktopDir = resolve(fileURLToPath(new URL("../../desktop", import.meta.url)));
199
200
  if (!existsSync(resolve(desktopDir, "package.json"))) {
200
- process.stderr.write("Desktop app files are missing from this install.\n");
201
+ process.stderr.write(
202
+ "Desktop app files are missing from this install. Reinstall @useavalon/caelence-agent or run caelence from a git checkout.\n",
203
+ );
201
204
  return 1;
202
205
  }
203
206
  const env = desktopToolchainEnv(desktopDir, cwd);