@webappwiz/arbor 0.0.28 → 0.0.30

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 (119) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +34 -12
  3. package/add.test.ts +125 -0
  4. package/add.ts +192 -0
  5. package/age.ts +11 -0
  6. package/arbor.test.ts +145 -0
  7. package/arbor.ts +429 -0
  8. package/assets.d.ts +9 -0
  9. package/attachments.ts +87 -0
  10. package/build.ts +98 -0
  11. package/claim.test.ts +89 -0
  12. package/claim.ts +73 -0
  13. package/components.json +21 -0
  14. package/config.ts +58 -0
  15. package/dev/api.ts +120 -0
  16. package/dev/app.test.tsx +645 -0
  17. package/dev/app.tsx +80 -0
  18. package/dev/assets.ts +16 -0
  19. package/dev/build/main.txt +68 -0
  20. package/dev/build/shell.txt +21 -0
  21. package/dev/build/styles.txt +2263 -0
  22. package/dev/components/ui/badge.tsx +51 -0
  23. package/dev/components/ui/button.tsx +57 -0
  24. package/dev/components/ui/dialog.tsx +154 -0
  25. package/dev/components/ui/empty.tsx +100 -0
  26. package/dev/components/ui/input-group.tsx +155 -0
  27. package/dev/components/ui/input.tsx +19 -0
  28. package/dev/components/ui/progress.tsx +80 -0
  29. package/dev/components/ui/textarea.tsx +17 -0
  30. package/dev/components/ui/toast.tsx +227 -0
  31. package/dev/feed.ts +69 -0
  32. package/dev/files.tsx +191 -0
  33. package/dev/index.html +21 -0
  34. package/dev/lib/utils.ts +7 -0
  35. package/dev/main.tsx +22 -0
  36. package/dev/markdown.test.tsx +133 -0
  37. package/dev/markdown.tsx +124 -0
  38. package/dev/mentions.tsx +319 -0
  39. package/dev/shadcn.css +649 -0
  40. package/dev/styles.css +107 -0
  41. package/dev/tags.tsx +44 -0
  42. package/dev/tasks.tsx +151 -0
  43. package/dev/todos.tsx +759 -0
  44. package/dev.test.ts +439 -0
  45. package/dev.ts +386 -0
  46. package/e2e.test.ts +256 -0
  47. package/escalate.test.ts +76 -0
  48. package/escalate.ts +112 -0
  49. package/exit.test.ts +71 -0
  50. package/exit.ts +74 -0
  51. package/git.ts +294 -0
  52. package/index.ts +9 -0
  53. package/journal.ts +89 -0
  54. package/list.test.ts +82 -0
  55. package/list.ts +137 -0
  56. package/load-config.test.ts +121 -0
  57. package/load-config.ts +62 -0
  58. package/log.test.ts +65 -0
  59. package/log.ts +40 -0
  60. package/merge.test.ts +332 -0
  61. package/merge.ts +283 -0
  62. package/package.json +32 -15
  63. package/path.test.ts +35 -0
  64. package/path.ts +38 -0
  65. package/plan.test.ts +318 -0
  66. package/plan.ts +302 -0
  67. package/progress.test.ts +54 -0
  68. package/progress.ts +31 -0
  69. package/remove.test.ts +68 -0
  70. package/remove.ts +88 -0
  71. package/repository.ts +83 -0
  72. package/retry.test.ts +43 -0
  73. package/retry.ts +48 -0
  74. package/shell.ts +44 -0
  75. package/show.test.ts +91 -0
  76. package/show.ts +151 -0
  77. package/snapshot.test.ts +33 -0
  78. package/snapshot.ts +84 -0
  79. package/table.ts +20 -0
  80. package/testing.ts +229 -0
  81. package/todo.test.ts +490 -0
  82. package/todo.ts +834 -0
  83. package/wait.test.ts +61 -0
  84. package/wait.ts +77 -0
  85. package/worktree-service.test.ts +158 -0
  86. package/worktree-service.ts +193 -0
  87. package/worktree.ts +239 -0
  88. package/add.d.ts +0 -23
  89. package/age.d.ts +0 -2
  90. package/arbor.d.ts +0 -11
  91. package/attachments.d.ts +0 -36
  92. package/claim.d.ts +0 -11
  93. package/config.d.ts +0 -55
  94. package/config.js +0 -7
  95. package/dev/assets.d.ts +0 -11
  96. package/dev.d.ts +0 -47
  97. package/escalate.d.ts +0 -28
  98. package/exit.d.ts +0 -42
  99. package/git.d.ts +0 -77
  100. package/index.d.ts +0 -2
  101. package/index.js +0 -4669
  102. package/journal.d.ts +0 -29
  103. package/list.d.ts +0 -18
  104. package/load-config.d.ts +0 -15
  105. package/log.d.ts +0 -14
  106. package/merge.d.ts +0 -24
  107. package/path.d.ts +0 -13
  108. package/plan.d.ts +0 -83
  109. package/remove.d.ts +0 -19
  110. package/repository.d.ts +0 -25
  111. package/retry.d.ts +0 -17
  112. package/shell.d.ts +0 -17
  113. package/show.d.ts +0 -53
  114. package/snapshot.d.ts +0 -31
  115. package/table.d.ts +0 -5
  116. package/todo.d.ts +0 -230
  117. package/wait.d.ts +0 -22
  118. package/worktree-service.d.ts +0 -51
  119. package/worktree.d.ts +0 -95
package/dev/app.tsx ADDED
@@ -0,0 +1,80 @@
1
+ import { useDisposerEffect, useReactive } from "@webappwiz/react";
2
+ import { type JSX, useEffect, useState } from "react";
3
+ import { Toaster } from "#dev/components/ui/toast.tsx";
4
+ import { Feed } from "./feed";
5
+ import { Tasks } from "./tasks";
6
+ import { Todos } from "./todos";
7
+
8
+ export function App(): JSX.Element {
9
+ // One Feed for as long as this component lives. `useReactive` subscribes to
10
+ // the source it saw on its first render, so an instance that got rebuilt
11
+ // would leave the page listening to the one it replaced, showing nothing.
12
+ const [feed] = useState(() => new Feed());
13
+ useDisposerEffect(
14
+ (disposer) => {
15
+ feed.start();
16
+ disposer.use(feed);
17
+ },
18
+ [feed],
19
+ );
20
+ const { snapshot, offline } = useReactive(
21
+ feed,
22
+ (feed) => ({ snapshot: feed.snapshot, offline: feed.offline }),
23
+ ["changed"],
24
+ );
25
+
26
+ useEffect(() => {
27
+ document.title = snapshot?.repo ?? "arbor";
28
+ }, [snapshot?.repo]);
29
+
30
+ return (
31
+ <Toaster>
32
+ <main className="mx-auto flex min-h-dvh max-w-xl flex-col gap-8 px-4 py-6">
33
+ <header className="flex items-center justify-between">
34
+ <div className="flex min-w-0 items-baseline gap-2">
35
+ <h1 className="shrink-0 font-medium text-sm">
36
+ {snapshot?.repo ?? "arbor"}
37
+ </h1>
38
+ {snapshot && (
39
+ <span className="min-w-0 truncate text-muted-foreground text-xs">
40
+ {snapshot.path}
41
+ </span>
42
+ )}
43
+ </div>
44
+ {/* Silent while connected, which is the normal case. Once the server
45
+ stops answering, the page says so, since what it shows may no
46
+ longer be true. */}
47
+ {offline && (
48
+ <span role="status" className="shrink-0 text-destructive text-xs">
49
+ Offline: is `arbor dev` still running?
50
+ </span>
51
+ )}
52
+ </header>
53
+ {/* Tasks first: there are only ever a few, and they are what is moving
54
+ right now. The todos below are what comes after. */}
55
+ {snapshot === null ? null : (
56
+ <>
57
+ <section aria-labelledby="tasks" className="flex flex-col gap-2">
58
+ <h2
59
+ id="tasks"
60
+ className="font-medium text-muted-foreground text-xs"
61
+ >
62
+ Tasks
63
+ </h2>
64
+ <Tasks tasks={snapshot.tasks} />
65
+ </section>
66
+ <section aria-labelledby="todos" className="flex flex-col gap-2">
67
+ <h2
68
+ id="todos"
69
+ className="font-medium text-muted-foreground text-xs"
70
+ >
71
+ Todos
72
+ </h2>
73
+ <Todos snapshot={snapshot} />
74
+ </section>
75
+ </>
76
+ )}
77
+ </main>
78
+ </Toaster>
79
+ );
80
+ }
package/dev/assets.ts ADDED
@@ -0,0 +1,16 @@
1
+ import script from "./build/main.txt" with { type: "text" };
2
+ import shell from "./build/shell.txt" with { type: "text" };
3
+ import styles from "./build/styles.txt" with { type: "text" };
4
+
5
+ /** The three files the browser asks for, as the server hands them over. */
6
+ export interface Assets {
7
+ /** The page, which asks for the other two. */
8
+ shell: string;
9
+ /** The React app, bundled for the browser. */
10
+ script: string;
11
+ /** The stylesheet, with Tailwind already compiled. */
12
+ styles: string;
13
+ }
14
+
15
+ /** The page this package ships. Serve each field's contents as-is. */
16
+ export const assets: Assets = { shell, script, styles };