@agimon-ai/doompi-git 0.0.1-alpha.3 → 0.0.1-alpha.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.
- package/README.md +2 -0
- package/dist/apiContracts.cjs +149 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +144 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/extensions/pi.cjs +109 -1
- package/dist/extensions/pi.cjs.map +1 -0
- package/dist/extensions/pi.d.mts +6 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +104 -1
- package/dist/extensions/pi.mjs.map +1 -0
- package/dist/extensions/server.cjs +495 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +490 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +580 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/gitDependencies-D-EUEIkE.mjs +22 -0
- package/dist/gitDependencies-D-EUEIkE.mjs.map +1 -0
- package/dist/gitDependencies-DKJr5kLQ.cjs +33 -0
- package/dist/gitDependencies-DKJr5kLQ.cjs.map +1 -0
- package/dist/index-BQq2vblZ.d.mts +143 -0
- package/dist/index-BQq2vblZ.d.mts.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.d.mts +2 -5
- package/dist/index.mjs +2 -1
- package/dist/runWorktree-B6ikYRrG.cjs +318 -0
- package/dist/runWorktree-B6ikYRrG.cjs.map +1 -0
- package/dist/runWorktree-BL99h9oH.mjs +289 -0
- package/dist/runWorktree-BL99h9oH.mjs.map +1 -0
- package/dist/worktreeOperations-DAbs0ZTX.mjs +1054 -0
- package/dist/worktreeOperations-DAbs0ZTX.mjs.map +1 -0
- package/dist/worktreeOperations-DjO_Y5Yv.cjs +1138 -0
- package/dist/worktreeOperations-DjO_Y5Yv.cjs.map +1 -0
- package/package.json +53 -39
- package/src/prompts/doompi-use-git/SKILL.md +5 -2
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/adapters/channel/worktreeChannel.cjs +0 -2
- package/dist/adapters/channel/worktreeChannel.cjs.map +0 -1
- package/dist/adapters/channel/worktreeChannel.d.cts +0 -40
- package/dist/adapters/channel/worktreeChannel.d.cts.map +0 -1
- package/dist/adapters/channel/worktreeChannel.d.mts +0 -40
- package/dist/adapters/channel/worktreeChannel.d.mts.map +0 -1
- package/dist/adapters/channel/worktreeChannel.mjs +0 -2
- package/dist/adapters/channel/worktreeChannel.mjs.map +0 -1
- package/dist/adapters/filesystem/atomicJson.cjs +0 -2
- package/dist/adapters/filesystem/atomicJson.cjs.map +0 -1
- package/dist/adapters/filesystem/atomicJson.mjs +0 -2
- package/dist/adapters/filesystem/atomicJson.mjs.map +0 -1
- package/dist/adapters/filesystem/paths.cjs +0 -2
- package/dist/adapters/filesystem/paths.cjs.map +0 -1
- package/dist/adapters/filesystem/paths.mjs +0 -2
- package/dist/adapters/filesystem/paths.mjs.map +0 -1
- package/dist/adapters/hub/hubClient.cjs +0 -2
- package/dist/adapters/hub/hubClient.cjs.map +0 -1
- package/dist/adapters/hub/hubClient.d.cts +0 -1
- package/dist/adapters/hub/hubClient.d.mts +0 -1
- package/dist/adapters/hub/hubClient.mjs +0 -2
- package/dist/adapters/hub/hubClient.mjs.map +0 -1
- package/dist/adapters/pi/extension.cjs +0 -2
- package/dist/adapters/pi/extension.cjs.map +0 -1
- package/dist/adapters/pi/extension.d.cts +0 -9
- package/dist/adapters/pi/extension.d.cts.map +0 -1
- package/dist/adapters/pi/extension.d.mts +0 -9
- package/dist/adapters/pi/extension.d.mts.map +0 -1
- package/dist/adapters/pi/extension.mjs +0 -2
- package/dist/adapters/pi/extension.mjs.map +0 -1
- package/dist/adapters/pi/extensions/runWorktreeTool.cjs +0 -15
- package/dist/adapters/pi/extensions/runWorktreeTool.cjs.map +0 -1
- package/dist/adapters/pi/extensions/runWorktreeTool.mjs +0 -15
- package/dist/adapters/pi/extensions/runWorktreeTool.mjs.map +0 -1
- package/dist/adapters/web/worktreesChannel.cjs +0 -2
- package/dist/adapters/web/worktreesChannel.cjs.map +0 -1
- package/dist/adapters/web/worktreesChannel.d.cts +0 -21
- package/dist/adapters/web/worktreesChannel.d.cts.map +0 -1
- package/dist/adapters/web/worktreesChannel.d.mts +0 -21
- package/dist/adapters/web/worktreesChannel.d.mts.map +0 -1
- package/dist/adapters/web/worktreesChannel.mjs +0 -2
- package/dist/adapters/web/worktreesChannel.mjs.map +0 -1
- package/dist/adapters/worktree/dependencyInstall.cjs +0 -2
- package/dist/adapters/worktree/dependencyInstall.cjs.map +0 -1
- package/dist/adapters/worktree/dependencyInstall.mjs +0 -2
- package/dist/adapters/worktree/dependencyInstall.mjs.map +0 -1
- package/dist/adapters/worktree/gitCli.cjs +0 -4
- package/dist/adapters/worktree/gitCli.cjs.map +0 -1
- package/dist/adapters/worktree/gitCli.mjs +0 -4
- package/dist/adapters/worktree/gitCli.mjs.map +0 -1
- package/dist/adapters/worktree/repositoryIdentity.cjs +0 -2
- package/dist/adapters/worktree/repositoryIdentity.cjs.map +0 -1
- package/dist/adapters/worktree/repositoryIdentity.mjs +0 -2
- package/dist/adapters/worktree/repositoryIdentity.mjs.map +0 -1
- package/dist/adapters/worktree/worktreeOperations.cjs +0 -2
- package/dist/adapters/worktree/worktreeOperations.cjs.map +0 -1
- package/dist/adapters/worktree/worktreeOperations.d.cts +0 -32
- package/dist/adapters/worktree/worktreeOperations.d.cts.map +0 -1
- package/dist/adapters/worktree/worktreeOperations.d.mts +0 -32
- package/dist/adapters/worktree/worktreeOperations.d.mts.map +0 -1
- package/dist/adapters/worktree/worktreeOperations.mjs +0 -2
- package/dist/adapters/worktree/worktreeOperations.mjs.map +0 -1
- package/dist/adapters/worktree/worktreeRegistry.cjs +0 -2
- package/dist/adapters/worktree/worktreeRegistry.cjs.map +0 -1
- package/dist/adapters/worktree/worktreeRegistry.mjs +0 -2
- package/dist/adapters/worktree/worktreeRegistry.mjs.map +0 -1
- package/dist/commands/doomGitCommand.cjs +0 -2
- package/dist/commands/doomGitCommand.cjs.map +0 -1
- package/dist/commands/doomGitCommand.mjs +0 -2
- package/dist/commands/doomGitCommand.mjs.map +0 -1
- package/dist/container/index.cjs +0 -2
- package/dist/container/index.cjs.map +0 -1
- package/dist/container/index.d.cts +0 -6
- package/dist/container/index.d.cts.map +0 -1
- package/dist/container/index.d.mts +0 -6
- package/dist/container/index.d.mts.map +0 -1
- package/dist/container/index.mjs +0 -2
- package/dist/container/index.mjs.map +0 -1
- package/dist/extensions/pi.d.cts +0 -2
- package/dist/hubApi.cjs +0 -2
- package/dist/hubApi.cjs.map +0 -1
- package/dist/hubApi.d.cts +0 -6
- package/dist/hubApi.d.cts.map +0 -1
- package/dist/hubApi.d.mts +0 -6
- package/dist/hubApi.d.mts.map +0 -1
- package/dist/hubApi.mjs +0 -2
- package/dist/hubApi.mjs.map +0 -1
- package/dist/index.d.cts +0 -5
- package/dist/schemas/runWorktreeTool.cjs +0 -2
- package/dist/schemas/runWorktreeTool.cjs.map +0 -1
- package/dist/schemas/runWorktreeTool.mjs +0 -2
- package/dist/schemas/runWorktreeTool.mjs.map +0 -1
- package/dist/services/extensionService.cjs +0 -2
- package/dist/services/extensionService.cjs.map +0 -1
- package/dist/services/extensionService.d.cts +0 -8
- package/dist/services/extensionService.d.cts.map +0 -1
- package/dist/services/extensionService.d.mts +0 -8
- package/dist/services/extensionService.d.mts.map +0 -1
- package/dist/services/extensionService.mjs +0 -2
- package/dist/services/extensionService.mjs.map +0 -1
- package/dist/services/support/errors.cjs +0 -2
- package/dist/services/support/errors.cjs.map +0 -1
- package/dist/services/support/errors.mjs +0 -2
- package/dist/services/support/errors.mjs.map +0 -1
- package/dist/services/worktreeNaming.cjs +0 -2
- package/dist/services/worktreeNaming.cjs.map +0 -1
- package/dist/services/worktreeNaming.d.cts +0 -27
- package/dist/services/worktreeNaming.d.cts.map +0 -1
- package/dist/services/worktreeNaming.d.mts +0 -27
- package/dist/services/worktreeNaming.d.mts.map +0 -1
- package/dist/services/worktreeNaming.mjs +0 -2
- package/dist/services/worktreeNaming.mjs.map +0 -1
- package/dist/types/extension.d.cts +0 -17
- package/dist/types/extension.d.cts.map +0 -1
- package/dist/types/extension.d.mts +0 -17
- package/dist/types/extension.d.mts.map +0 -1
- package/dist/types/webWorktrees.cjs +0 -2
- package/dist/types/webWorktrees.cjs.map +0 -1
- package/dist/types/webWorktrees.mjs +0 -2
- package/dist/types/webWorktrees.mjs.map +0 -1
- package/dist/types/worktreeRegistry.d.cts +0 -41
- package/dist/types/worktreeRegistry.d.cts.map +0 -1
- package/dist/types/worktreeRegistry.d.mts +0 -41
- package/dist/types/worktreeRegistry.d.mts.map +0 -1
- package/dist/webHub.cjs +0 -1
- package/dist/webHub.d.cts +0 -2
- package/dist/webHub.d.mts +0 -2
- package/dist/webHub.mjs +0 -1
- package/src/exports/webClient.ts +0 -1
- package/src/types/webWorktrees.ts +0 -55
- package/src/types/worktreeRegistry.ts +0 -69
- package/src/web/components/RunWorktreeToolMessage.tsx +0 -37
- package/src/web/components/WorktreesActivitySection.tsx +0 -64
- package/src/web/components/WorktreesPanel.tsx +0 -125
- package/src/web/components/toolRenderers.ts +0 -7
- package/src/web/index.ts +0 -30
- package/src/web/stores/worktreesActivityStore.ts +0 -124
- package/src/web/tsconfig.json +0 -22
|
@@ -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
|
-
}
|
package/src/web/tsconfig.json
DELETED
|
@@ -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
|
-
}
|