@agimon-ai/doompi-git 0.0.1-alpha.4 → 0.0.1-alpha.40

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 (180) hide show
  1. package/README.md +33 -1
  2. package/dist/apiContracts.cjs +387 -0
  3. package/dist/apiContracts.cjs.map +1 -0
  4. package/dist/apiContracts.d.mts +53 -0
  5. package/dist/apiContracts.d.mts.map +1 -0
  6. package/dist/apiContracts.mjs +382 -0
  7. package/dist/apiContracts.mjs.map +1 -0
  8. package/dist/extensions/pi.cjs +105 -1
  9. package/dist/extensions/pi.cjs.map +1 -0
  10. package/dist/extensions/pi.d.mts +6 -2
  11. package/dist/extensions/pi.d.mts.map +1 -0
  12. package/dist/extensions/pi.mjs +100 -1
  13. package/dist/extensions/pi.mjs.map +1 -0
  14. package/dist/extensions/server.cjs +1828 -0
  15. package/dist/extensions/server.cjs.map +1 -0
  16. package/dist/extensions/server.d.mts +5 -0
  17. package/dist/extensions/server.d.mts.map +1 -0
  18. package/dist/extensions/server.mjs +1820 -0
  19. package/dist/extensions/server.mjs.map +1 -0
  20. package/dist/extensions/web.mjs +2619 -0
  21. package/dist/extensions/web.mjs.map +1 -0
  22. package/dist/gitDependencies-CtVubYvU.mjs +22 -0
  23. package/dist/gitDependencies-CtVubYvU.mjs.map +1 -0
  24. package/dist/gitDependencies-Dqsz2HjK.cjs +33 -0
  25. package/dist/gitDependencies-Dqsz2HjK.cjs.map +1 -0
  26. package/dist/index-D79MSCee.d.mts +145 -0
  27. package/dist/index-D79MSCee.d.mts.map +1 -0
  28. package/dist/index.cjs +4 -1
  29. package/dist/index.d.mts +2 -5
  30. package/dist/index.mjs +2 -1
  31. package/dist/runWorktree-BE795LxL.cjs +374 -0
  32. package/dist/runWorktree-BE795LxL.cjs.map +1 -0
  33. package/dist/runWorktree-SPzJvIBt.mjs +303 -0
  34. package/dist/runWorktree-SPzJvIBt.mjs.map +1 -0
  35. package/dist/worktreeOperations-BYmVU0UV.cjs +1350 -0
  36. package/dist/worktreeOperations-BYmVU0UV.cjs.map +1 -0
  37. package/dist/worktreeOperations-BrWG2muV.mjs +1194 -0
  38. package/dist/worktreeOperations-BrWG2muV.mjs.map +1 -0
  39. package/llms.txt +4 -0
  40. package/package.json +56 -41
  41. package/src/prompts/doompi-use-git/SKILL.md +26 -3
  42. package/dist/_virtual/_rolldown/runtime.cjs +0 -1
  43. package/dist/adapters/channel/worktreeChannel.cjs +0 -2
  44. package/dist/adapters/channel/worktreeChannel.cjs.map +0 -1
  45. package/dist/adapters/channel/worktreeChannel.d.cts +0 -40
  46. package/dist/adapters/channel/worktreeChannel.d.cts.map +0 -1
  47. package/dist/adapters/channel/worktreeChannel.d.mts +0 -40
  48. package/dist/adapters/channel/worktreeChannel.d.mts.map +0 -1
  49. package/dist/adapters/channel/worktreeChannel.mjs +0 -2
  50. package/dist/adapters/channel/worktreeChannel.mjs.map +0 -1
  51. package/dist/adapters/filesystem/atomicJson.cjs +0 -2
  52. package/dist/adapters/filesystem/atomicJson.cjs.map +0 -1
  53. package/dist/adapters/filesystem/atomicJson.mjs +0 -2
  54. package/dist/adapters/filesystem/atomicJson.mjs.map +0 -1
  55. package/dist/adapters/filesystem/paths.cjs +0 -2
  56. package/dist/adapters/filesystem/paths.cjs.map +0 -1
  57. package/dist/adapters/filesystem/paths.mjs +0 -2
  58. package/dist/adapters/filesystem/paths.mjs.map +0 -1
  59. package/dist/adapters/hub/hubClient.cjs +0 -2
  60. package/dist/adapters/hub/hubClient.cjs.map +0 -1
  61. package/dist/adapters/hub/hubClient.d.cts +0 -1
  62. package/dist/adapters/hub/hubClient.d.mts +0 -1
  63. package/dist/adapters/hub/hubClient.mjs +0 -2
  64. package/dist/adapters/hub/hubClient.mjs.map +0 -1
  65. package/dist/adapters/pi/extension.cjs +0 -2
  66. package/dist/adapters/pi/extension.cjs.map +0 -1
  67. package/dist/adapters/pi/extension.d.cts +0 -9
  68. package/dist/adapters/pi/extension.d.cts.map +0 -1
  69. package/dist/adapters/pi/extension.d.mts +0 -9
  70. package/dist/adapters/pi/extension.d.mts.map +0 -1
  71. package/dist/adapters/pi/extension.mjs +0 -2
  72. package/dist/adapters/pi/extension.mjs.map +0 -1
  73. package/dist/adapters/pi/extensions/runWorktreeTool.cjs +0 -15
  74. package/dist/adapters/pi/extensions/runWorktreeTool.cjs.map +0 -1
  75. package/dist/adapters/pi/extensions/runWorktreeTool.mjs +0 -15
  76. package/dist/adapters/pi/extensions/runWorktreeTool.mjs.map +0 -1
  77. package/dist/adapters/web/worktreesChannel.cjs +0 -2
  78. package/dist/adapters/web/worktreesChannel.cjs.map +0 -1
  79. package/dist/adapters/web/worktreesChannel.d.cts +0 -21
  80. package/dist/adapters/web/worktreesChannel.d.cts.map +0 -1
  81. package/dist/adapters/web/worktreesChannel.d.mts +0 -21
  82. package/dist/adapters/web/worktreesChannel.d.mts.map +0 -1
  83. package/dist/adapters/web/worktreesChannel.mjs +0 -2
  84. package/dist/adapters/web/worktreesChannel.mjs.map +0 -1
  85. package/dist/adapters/worktree/dependencyInstall.cjs +0 -2
  86. package/dist/adapters/worktree/dependencyInstall.cjs.map +0 -1
  87. package/dist/adapters/worktree/dependencyInstall.mjs +0 -2
  88. package/dist/adapters/worktree/dependencyInstall.mjs.map +0 -1
  89. package/dist/adapters/worktree/gitCli.cjs +0 -4
  90. package/dist/adapters/worktree/gitCli.cjs.map +0 -1
  91. package/dist/adapters/worktree/gitCli.mjs +0 -4
  92. package/dist/adapters/worktree/gitCli.mjs.map +0 -1
  93. package/dist/adapters/worktree/repositoryIdentity.cjs +0 -2
  94. package/dist/adapters/worktree/repositoryIdentity.cjs.map +0 -1
  95. package/dist/adapters/worktree/repositoryIdentity.mjs +0 -2
  96. package/dist/adapters/worktree/repositoryIdentity.mjs.map +0 -1
  97. package/dist/adapters/worktree/worktreeOperations.cjs +0 -2
  98. package/dist/adapters/worktree/worktreeOperations.cjs.map +0 -1
  99. package/dist/adapters/worktree/worktreeOperations.d.cts +0 -32
  100. package/dist/adapters/worktree/worktreeOperations.d.cts.map +0 -1
  101. package/dist/adapters/worktree/worktreeOperations.d.mts +0 -32
  102. package/dist/adapters/worktree/worktreeOperations.d.mts.map +0 -1
  103. package/dist/adapters/worktree/worktreeOperations.mjs +0 -2
  104. package/dist/adapters/worktree/worktreeOperations.mjs.map +0 -1
  105. package/dist/adapters/worktree/worktreeRegistry.cjs +0 -2
  106. package/dist/adapters/worktree/worktreeRegistry.cjs.map +0 -1
  107. package/dist/adapters/worktree/worktreeRegistry.mjs +0 -2
  108. package/dist/adapters/worktree/worktreeRegistry.mjs.map +0 -1
  109. package/dist/commands/doomGitCommand.cjs +0 -2
  110. package/dist/commands/doomGitCommand.cjs.map +0 -1
  111. package/dist/commands/doomGitCommand.mjs +0 -2
  112. package/dist/commands/doomGitCommand.mjs.map +0 -1
  113. package/dist/container/index.cjs +0 -2
  114. package/dist/container/index.cjs.map +0 -1
  115. package/dist/container/index.d.cts +0 -6
  116. package/dist/container/index.d.cts.map +0 -1
  117. package/dist/container/index.d.mts +0 -6
  118. package/dist/container/index.d.mts.map +0 -1
  119. package/dist/container/index.mjs +0 -2
  120. package/dist/container/index.mjs.map +0 -1
  121. package/dist/extensions/pi.d.cts +0 -2
  122. package/dist/hubApi.cjs +0 -2
  123. package/dist/hubApi.cjs.map +0 -1
  124. package/dist/hubApi.d.cts +0 -6
  125. package/dist/hubApi.d.cts.map +0 -1
  126. package/dist/hubApi.d.mts +0 -6
  127. package/dist/hubApi.d.mts.map +0 -1
  128. package/dist/hubApi.mjs +0 -2
  129. package/dist/hubApi.mjs.map +0 -1
  130. package/dist/index.d.cts +0 -5
  131. package/dist/schemas/runWorktreeTool.cjs +0 -2
  132. package/dist/schemas/runWorktreeTool.cjs.map +0 -1
  133. package/dist/schemas/runWorktreeTool.mjs +0 -2
  134. package/dist/schemas/runWorktreeTool.mjs.map +0 -1
  135. package/dist/services/extensionService.cjs +0 -2
  136. package/dist/services/extensionService.cjs.map +0 -1
  137. package/dist/services/extensionService.d.cts +0 -8
  138. package/dist/services/extensionService.d.cts.map +0 -1
  139. package/dist/services/extensionService.d.mts +0 -8
  140. package/dist/services/extensionService.d.mts.map +0 -1
  141. package/dist/services/extensionService.mjs +0 -2
  142. package/dist/services/extensionService.mjs.map +0 -1
  143. package/dist/services/support/errors.cjs +0 -2
  144. package/dist/services/support/errors.cjs.map +0 -1
  145. package/dist/services/support/errors.mjs +0 -2
  146. package/dist/services/support/errors.mjs.map +0 -1
  147. package/dist/services/worktreeNaming.cjs +0 -2
  148. package/dist/services/worktreeNaming.cjs.map +0 -1
  149. package/dist/services/worktreeNaming.d.cts +0 -27
  150. package/dist/services/worktreeNaming.d.cts.map +0 -1
  151. package/dist/services/worktreeNaming.d.mts +0 -27
  152. package/dist/services/worktreeNaming.d.mts.map +0 -1
  153. package/dist/services/worktreeNaming.mjs +0 -2
  154. package/dist/services/worktreeNaming.mjs.map +0 -1
  155. package/dist/types/extension.d.cts +0 -17
  156. package/dist/types/extension.d.cts.map +0 -1
  157. package/dist/types/extension.d.mts +0 -17
  158. package/dist/types/extension.d.mts.map +0 -1
  159. package/dist/types/webWorktrees.cjs +0 -2
  160. package/dist/types/webWorktrees.cjs.map +0 -1
  161. package/dist/types/webWorktrees.mjs +0 -2
  162. package/dist/types/webWorktrees.mjs.map +0 -1
  163. package/dist/types/worktreeRegistry.d.cts +0 -41
  164. package/dist/types/worktreeRegistry.d.cts.map +0 -1
  165. package/dist/types/worktreeRegistry.d.mts +0 -41
  166. package/dist/types/worktreeRegistry.d.mts.map +0 -1
  167. package/dist/webHub.cjs +0 -1
  168. package/dist/webHub.d.cts +0 -2
  169. package/dist/webHub.d.mts +0 -2
  170. package/dist/webHub.mjs +0 -1
  171. package/src/exports/webClient.ts +0 -1
  172. package/src/types/webWorktrees.ts +0 -55
  173. package/src/types/worktreeRegistry.ts +0 -69
  174. package/src/web/components/RunWorktreeToolMessage.tsx +0 -37
  175. package/src/web/components/WorktreesActivitySection.tsx +0 -64
  176. package/src/web/components/WorktreesPanel.tsx +0 -125
  177. package/src/web/components/toolRenderers.ts +0 -7
  178. package/src/web/index.ts +0 -30
  179. package/src/web/stores/worktreesActivityStore.ts +0 -124
  180. package/src/web/tsconfig.json +0 -22
@@ -1,7 +0,0 @@
1
- import type { ToolRendererContribution } from '@agimon-ai/doompi-web-contracts';
2
- import { RunWorktreeToolMessage } from './RunWorktreeToolMessage.tsx';
3
-
4
- /** The timeline items for this package's tools. */
5
- export const gitToolRenderers: ToolRendererContribution[] = [
6
- { tools: ['run_worktree'], message: RunWorktreeToolMessage },
7
- ];
package/src/web/index.ts DELETED
@@ -1,30 +0,0 @@
1
- import { defineWebPlugin } from '@agimon-ai/doompi-web-contracts';
2
- import { gitToolRenderers } from './components/toolRenderers.ts';
3
- import { WorktreesActivitySection } from './components/WorktreesActivitySection.tsx';
4
- import { worktreesTab } from './components/WorktreesPanel.tsx';
5
- import { startWorktreeRuntime, worktreeActivitySource, worktreesChannel } from './stores/worktreesActivityStore.ts';
6
-
7
- /** The named export the generated plugin registry imports. */
8
- export const webPlugin = defineWebPlugin({
9
- id: 'git',
10
- channels: [worktreesChannel],
11
- // The panel commands the hub over its own channel, which needs the page's
12
- // hub socket rather than the per-session frame sender the slots carry.
13
- start: startWorktreeRuntime,
14
- activityGroups: [
15
- {
16
- name: 'git',
17
- keys: 'g w',
18
- // The source keeps the group present while idle, which is exactly when
19
- // its launcher matters: a repository with no worktrees is where someone
20
- // wants to make the first one.
21
- activeSource: worktreeActivitySource,
22
- // A standing worktree is not background work in progress; it is state.
23
- marksBackgroundWork: false,
24
- transientTab: worktreesTab,
25
- order: 30,
26
- },
27
- ],
28
- activitySections: [{ id: 'git', component: WorktreesActivitySection }],
29
- toolRenderers: gitToolRenderers,
30
- });
@@ -1,124 +0,0 @@
1
- /**
2
- * The dock's view of this session's worktrees, and the commands it sends.
3
- *
4
- * DESIGN PATTERNS:
5
- * - Session-scoped store fed by one hub channel. The hub is authoritative; the
6
- * page never reads a registry and never guesses.
7
- * - Actions are channel frames, not prompts. The hub half owns the tool's
8
- * operations, so the panel names the work and the hub performs it; a
9
- * worktree made from the dock is the same object the tool makes, without
10
- * spending a turn of the conversation to ask for it.
11
- * - The sender lives in a store rather than a module variable, because a web
12
- * plugin keeps no mutable module state and the page may reconnect.
13
- *
14
- * AVOID:
15
- * - Calling the hub package API from here. A dock slot gets no sealed request
16
- * transport, and raw fetch breaks the remote cockpit.
17
- * - `sendSessionFrame` for a command. It envelopes the frame as a session
18
- * command bound for the agent, which never reaches a channel's `receive`.
19
- */
20
- import { defineGlobalStore, defineSessionStore, type WebPluginRuntime } from '@agimon-ai/doompi-web-contracts';
21
- import { GIT_WORKTREES_TYPE, type GitWorktreesCommand, type WorktreeView } from '../../types/webWorktrees.ts';
22
-
23
- export interface WorktreesSession {
24
- /** The worktrees the hub last reported for this session's repository. */
25
- worktrees: WorktreeView[];
26
- /** Label of the operation the hub is running for this session. */
27
- pending: string | undefined;
28
- /** The last failure the hub reported, shown until the next command. */
29
- error: string | undefined;
30
- }
31
-
32
- export const worktreeActivity = defineSessionStore<WorktreesSession>({
33
- worktrees: [],
34
- pending: undefined,
35
- error: undefined,
36
- });
37
-
38
- /**
39
- * The page's hub socket sender, held for as long as the plugin runs.
40
- *
41
- * Undefined before `startWorktreeRuntime` and after it disposes; a command
42
- * sent in that window is dropped rather than queued, because a queue would
43
- * replay a worktree create against a socket that has since changed sessions.
44
- */
45
- const worktreeSender = defineGlobalStore<WebPluginRuntime['sendHubFrame'] | undefined>(undefined);
46
-
47
- /** Binds the page's hub socket. The plugin host calls this once per page. */
48
- export function startWorktreeRuntime(runtime: WebPluginRuntime): () => void {
49
- // Wrapped rather than referenced: an unbound method would lose the runtime
50
- // it belongs to the moment the store hands it back.
51
- const send = (frame: Record<string, unknown>): void => {
52
- runtime.sendHubFrame(frame);
53
- };
54
- worktreeSender.update(() => send);
55
- return () => {
56
- worktreeSender.update((current) => (current === send ? undefined : current));
57
- };
58
- }
59
-
60
- /**
61
- * Whether this session has worktree work in flight.
62
- *
63
- * A standing worktree is state, not work: it sits there until someone closes
64
- * it, so counting it would leave the session reading as busy forever, with a
65
- * "background work is still running" notice under a conversation where
66
- * nothing is running. Only a create or close actually in progress counts.
67
- *
68
- * The group stays visible either way. Declaring an active source at all is
69
- * what keeps it in the dock; this answers how it is drawn, not whether it is
70
- * there.
71
- */
72
- export const worktreeActivitySource = {
73
- subscribe(listener: () => void) {
74
- const subscription = worktreeActivity.store.subscribe(listener);
75
- return () => subscription.unsubscribe();
76
- },
77
- isActive(sessionId: string | null) {
78
- return worktreeActivity.select(worktreeActivity.store.state, sessionId).pending !== undefined;
79
- },
80
- };
81
-
82
- function isRecord(value: unknown): value is Record<string, unknown> {
83
- return typeof value === 'object' && value !== null && !Array.isArray(value);
84
- }
85
-
86
- function optionalText(value: unknown): string | undefined {
87
- return typeof value === 'string' && value !== '' ? value : undefined;
88
- }
89
-
90
- /** The plugin's session data channel: 'git_worktrees' payloads into the store. */
91
- export const worktreesChannel = worktreeActivity.channel<WorktreesSession>({
92
- channel: GIT_WORKTREES_TYPE,
93
- parse(input) {
94
- if (!isRecord(input) || !Array.isArray(input.worktrees)) return null;
95
- return {
96
- worktrees: input.worktrees.filter(isRecord) as unknown as WorktreeView[],
97
- pending: optionalText(input.pending),
98
- error: optionalText(input.error),
99
- };
100
- },
101
- reduce(_current, next) {
102
- return next;
103
- },
104
- });
105
-
106
- /** Sends one command to the session's worktrees channel. */
107
- function command(sessionId: string, payload: GitWorktreesCommand): void {
108
- worktreeSender.store.state?.({ type: GIT_WORKTREES_TYPE, sessionId, payload });
109
- }
110
-
111
- /** Asks the hub for a worktree. The hub answers on the same channel. */
112
- export function requestWorktreeCreate(sessionId: string, branch: string, baseRef: string): void {
113
- const trimmedBase = baseRef.trim();
114
- command(sessionId, {
115
- action: 'create',
116
- branch: branch.trim(),
117
- ...(trimmedBase === '' ? {} : { baseRef: trimmedBase }),
118
- });
119
- }
120
-
121
- /** Asks the hub to close one worktree. Refusal on a dirty tree stays the hub's call. */
122
- export function requestWorktreeClose(sessionId: string, id: string): void {
123
- command(sessionId, { action: 'close', id });
124
- }
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "lib": ["ES2023", "DOM", "DOM.Iterable"],
5
- "module": "ESNext",
6
- "moduleResolution": "Bundler",
7
- "jsx": "react-jsx",
8
- "strict": true,
9
- "noImplicitAny": true,
10
- "noUnusedLocals": true,
11
- "noUnusedParameters": true,
12
- "noImplicitReturns": true,
13
- "noFallthroughCasesInSwitch": true,
14
- "noEmit": true,
15
- "resolveJsonModule": true,
16
- "esModuleInterop": true,
17
- "skipLibCheck": true,
18
- "allowImportingTsExtensions": true,
19
- "forceConsistentCasingInFileNames": true
20
- },
21
- "include": [".", "../types/worktreeRegistry.ts", "../types/webWorktrees.ts", "../exports/webClient.ts"]
22
- }