@edspencer/paddock 0.0.1 → 0.56.0
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 +69 -0
- package/install-notice.mjs +29 -0
- package/package.json +58 -5
- package/packages/server/dist/adoptable.d.ts +127 -0
- package/packages/server/dist/adoptable.js +315 -0
- package/packages/server/dist/app.d.ts +67 -0
- package/packages/server/dist/app.js +325 -0
- package/packages/server/dist/archive.d.ts +42 -0
- package/packages/server/dist/archive.js +125 -0
- package/packages/server/dist/attachments-config.d.ts +114 -0
- package/packages/server/dist/attachments-config.js +165 -0
- package/packages/server/dist/attachments-hint.d.ts +53 -0
- package/packages/server/dist/attachments-hint.js +140 -0
- package/packages/server/dist/attachments.d.ts +33 -0
- package/packages/server/dist/attachments.js +117 -0
- package/packages/server/dist/auth.d.ts +84 -0
- package/packages/server/dist/auth.js +247 -0
- package/packages/server/dist/background.d.ts +36 -0
- package/packages/server/dist/background.js +137 -0
- package/packages/server/dist/bind-safety.d.ts +56 -0
- package/packages/server/dist/bind-safety.js +51 -0
- package/packages/server/dist/brand.d.ts +44 -0
- package/packages/server/dist/brand.js +88 -0
- package/packages/server/dist/chat-dto.d.ts +210 -0
- package/packages/server/dist/chat-dto.js +308 -0
- package/packages/server/dist/cli/import-chats.d.ts +21 -0
- package/packages/server/dist/cli/import-chats.js +197 -0
- package/packages/server/dist/cli/paddock.d.ts +2 -0
- package/packages/server/dist/cli/paddock.js +247 -0
- package/packages/server/dist/concurrency.d.ts +57 -0
- package/packages/server/dist/concurrency.js +71 -0
- package/packages/server/dist/config.d.ts +512 -0
- package/packages/server/dist/config.js +593 -0
- package/packages/server/dist/curation-config.d.ts +55 -0
- package/packages/server/dist/curation-config.js +64 -0
- package/packages/server/dist/event-bus.d.ts +87 -0
- package/packages/server/dist/event-bus.js +48 -0
- package/packages/server/dist/git.d.ts +128 -0
- package/packages/server/dist/git.js +446 -0
- package/packages/server/dist/github-auth.d.ts +44 -0
- package/packages/server/dist/github-auth.js +169 -0
- package/packages/server/dist/herdctl-agent-config.d.ts +98 -0
- package/packages/server/dist/herdctl-agent-config.js +331 -0
- package/packages/server/dist/herdctl-agent-names.d.ts +172 -0
- package/packages/server/dist/herdctl-agent-names.js +228 -0
- package/packages/server/dist/herdctl-jobs-index.d.ts +65 -0
- package/packages/server/dist/herdctl-jobs-index.js +225 -0
- package/packages/server/dist/herdctl-jobs.d.ts +98 -0
- package/packages/server/dist/herdctl-jobs.js +225 -0
- package/packages/server/dist/herdctl.d.ts +572 -0
- package/packages/server/dist/herdctl.js +1218 -0
- package/packages/server/dist/hook-config.d.ts +217 -0
- package/packages/server/dist/hook-config.js +224 -0
- package/packages/server/dist/http-bytes.d.ts +24 -0
- package/packages/server/dist/http-bytes.js +52 -0
- package/packages/server/dist/index.d.ts +1 -0
- package/packages/server/dist/index.js +14 -0
- package/packages/server/dist/instance-config.d.ts +135 -0
- package/packages/server/dist/instance-config.js +345 -0
- package/packages/server/dist/localcommand.d.ts +23 -0
- package/packages/server/dist/localcommand.js +140 -0
- package/packages/server/dist/management-auth.d.ts +99 -0
- package/packages/server/dist/management-auth.js +165 -0
- package/packages/server/dist/management-config.d.ts +164 -0
- package/packages/server/dist/management-config.js +286 -0
- package/packages/server/dist/management-mcp-server.d.ts +20 -0
- package/packages/server/dist/management-mcp-server.js +95 -0
- package/packages/server/dist/management-metadata.d.ts +67 -0
- package/packages/server/dist/management-metadata.js +56 -0
- package/packages/server/dist/management-ops.d.ts +110 -0
- package/packages/server/dist/management-ops.js +449 -0
- package/packages/server/dist/management-policy.d.ts +172 -0
- package/packages/server/dist/management-policy.js +259 -0
- package/packages/server/dist/message-provenance.d.ts +112 -0
- package/packages/server/dist/message-provenance.js +260 -0
- package/packages/server/dist/models.d.ts +164 -0
- package/packages/server/dist/models.js +208 -0
- package/packages/server/dist/openapi.d.ts +66 -0
- package/packages/server/dist/openapi.js +183 -0
- package/packages/server/dist/parent-detach.d.ts +30 -0
- package/packages/server/dist/parent-detach.js +109 -0
- package/packages/server/dist/preload.d.ts +43 -0
- package/packages/server/dist/preload.js +55 -0
- package/packages/server/dist/project-files.d.ts +76 -0
- package/packages/server/dist/project-files.js +191 -0
- package/packages/server/dist/project-mime.d.ts +35 -0
- package/packages/server/dist/project-mime.js +55 -0
- package/packages/server/dist/project-paths.d.ts +88 -0
- package/packages/server/dist/project-paths.js +126 -0
- package/packages/server/dist/project-types.d.ts +316 -0
- package/packages/server/dist/project-types.js +48 -0
- package/packages/server/dist/projects.d.ts +202 -0
- package/packages/server/dist/projects.js +894 -0
- package/packages/server/dist/queued-message.d.ts +35 -0
- package/packages/server/dist/queued-message.js +116 -0
- package/packages/server/dist/read-state.d.ts +46 -0
- package/packages/server/dist/read-state.js +139 -0
- package/packages/server/dist/recovery-config.d.ts +111 -0
- package/packages/server/dist/recovery-config.js +105 -0
- package/packages/server/dist/recovery.d.ts +262 -0
- package/packages/server/dist/recovery.js +490 -0
- package/packages/server/dist/resume-drain.d.ts +122 -0
- package/packages/server/dist/resume-drain.js +158 -0
- package/packages/server/dist/route-context.d.ts +168 -0
- package/packages/server/dist/route-context.js +39 -0
- package/packages/server/dist/route-errors.d.ts +8 -0
- package/packages/server/dist/route-errors.js +13 -0
- package/packages/server/dist/routes/chats.d.ts +12 -0
- package/packages/server/dist/routes/chats.js +1406 -0
- package/packages/server/dist/routes/git.d.ts +13 -0
- package/packages/server/dist/routes/git.js +236 -0
- package/packages/server/dist/routes/mcp.d.ts +83 -0
- package/packages/server/dist/routes/mcp.js +250 -0
- package/packages/server/dist/routes/meta.d.ts +15 -0
- package/packages/server/dist/routes/meta.js +447 -0
- package/packages/server/dist/routes/projects.d.ts +25 -0
- package/packages/server/dist/routes/projects.js +736 -0
- package/packages/server/dist/routes/triggers.d.ts +21 -0
- package/packages/server/dist/routes/triggers.js +324 -0
- package/packages/server/dist/routes/workspace-mount.d.ts +48 -0
- package/packages/server/dist/routes/workspace-mount.js +32 -0
- package/packages/server/dist/routes.d.ts +26 -0
- package/packages/server/dist/routes.js +29 -0
- package/packages/server/dist/run-provenance.d.ts +109 -0
- package/packages/server/dist/run-provenance.js +206 -0
- package/packages/server/dist/runs.d.ts +92 -0
- package/packages/server/dist/runs.js +72 -0
- package/packages/server/dist/schedule-config.d.ts +68 -0
- package/packages/server/dist/schedule-config.js +75 -0
- package/packages/server/dist/schedule-session.d.ts +34 -0
- package/packages/server/dist/schedule-session.js +120 -0
- package/packages/server/dist/self-mcp-descriptions.d.ts +20 -0
- package/packages/server/dist/self-mcp-descriptions.js +145 -0
- package/packages/server/dist/self-mcp-read.d.ts +15 -0
- package/packages/server/dist/self-mcp-read.js +97 -0
- package/packages/server/dist/self-mcp-triggers.d.ts +30 -0
- package/packages/server/dist/self-mcp-triggers.js +144 -0
- package/packages/server/dist/self-mcp-types.d.ts +248 -0
- package/packages/server/dist/self-mcp-types.js +10 -0
- package/packages/server/dist/self-mcp-util.d.ts +73 -0
- package/packages/server/dist/self-mcp-util.js +157 -0
- package/packages/server/dist/self-mcp-write.d.ts +35 -0
- package/packages/server/dist/self-mcp-write.js +215 -0
- package/packages/server/dist/self-mcp.d.ts +95 -0
- package/packages/server/dist/self-mcp.js +448 -0
- package/packages/server/dist/send-file-mcp.d.ts +46 -0
- package/packages/server/dist/send-file-mcp.js +281 -0
- package/packages/server/dist/session-hub.d.ts +186 -0
- package/packages/server/dist/session-hub.js +291 -0
- package/packages/server/dist/spawn-capability.d.ts +99 -0
- package/packages/server/dist/spawn-capability.js +106 -0
- package/packages/server/dist/star.d.ts +26 -0
- package/packages/server/dist/star.js +94 -0
- package/packages/server/dist/start.d.ts +1 -0
- package/packages/server/dist/start.js +21 -0
- package/packages/server/dist/subagents.d.ts +337 -0
- package/packages/server/dist/subagents.js +626 -0
- package/packages/server/dist/sweep.d.ts +122 -0
- package/packages/server/dist/sweep.js +696 -0
- package/packages/server/dist/tooldetails.d.ts +33 -0
- package/packages/server/dist/tooldetails.js +466 -0
- package/packages/server/dist/transcribe.d.ts +69 -0
- package/packages/server/dist/transcribe.js +119 -0
- package/packages/server/dist/transcripts.d.ts +42 -0
- package/packages/server/dist/transcripts.js +164 -0
- package/packages/server/dist/trigger-config.d.ts +278 -0
- package/packages/server/dist/trigger-config.js +417 -0
- package/packages/server/dist/trigger-runtime.d.ts +94 -0
- package/packages/server/dist/trigger-runtime.js +82 -0
- package/packages/server/dist/trigger-session.d.ts +34 -0
- package/packages/server/dist/trigger-session.js +122 -0
- package/packages/server/dist/triggers.d.ts +83 -0
- package/packages/server/dist/triggers.js +124 -0
- package/packages/server/dist/trusted-proxy.d.ts +57 -0
- package/packages/server/dist/trusted-proxy.js +157 -0
- package/packages/server/dist/turn-notice.d.ts +154 -0
- package/packages/server/dist/turn-notice.js +271 -0
- package/packages/server/dist/unread.d.ts +36 -0
- package/packages/server/dist/unread.js +123 -0
- package/packages/server/dist/usage.d.ts +66 -0
- package/packages/server/dist/usage.js +243 -0
- package/packages/server/dist/wake-injection.d.ts +156 -0
- package/packages/server/dist/wake-injection.js +136 -0
- package/packages/server/dist/whisper-local.d.ts +9 -0
- package/packages/server/dist/whisper-local.js +122 -0
- package/packages/server/dist/ws-context.d.ts +158 -0
- package/packages/server/dist/ws-context.js +1 -0
- package/packages/server/dist/ws-protocol.d.ts +423 -0
- package/packages/server/dist/ws-protocol.js +251 -0
- package/packages/server/dist/ws-self-mcp.d.ts +52 -0
- package/packages/server/dist/ws-self-mcp.js +28 -0
- package/packages/server/dist/ws-triggers.d.ts +29 -0
- package/packages/server/dist/ws-triggers.js +261 -0
- package/packages/server/dist/ws-turn.d.ts +86 -0
- package/packages/server/dist/ws-turn.js +751 -0
- package/packages/server/dist/ws.d.ts +62 -0
- package/packages/server/dist/ws.js +1024 -0
- package/packages/server/package.json +6 -0
- package/packages/web/dist/assets/InstanceConfigPage-4cQGTj9Y.js +2 -0
- package/packages/web/dist/assets/MarkdownRenderer-CJZFLj_8.js +30 -0
- package/packages/web/dist/assets/ProjectRedirect-BHwVbbqB.js +2 -0
- package/packages/web/dist/assets/ProjectView-BOvuAITg.js +13 -0
- package/packages/web/dist/assets/ProjectsGrid-BCojZOGY.js +2 -0
- package/packages/web/dist/assets/arc-BVyxvnkl.js +2 -0
- package/packages/web/dist/assets/architectureDiagram-3BPJPVTR-Cd9Puqg1.js +37 -0
- package/packages/web/dist/assets/bash-I8pq0VWm.js +2 -0
- package/packages/web/dist/assets/blockDiagram-GPEHLZMM-B_AQt_Rx.js +133 -0
- package/packages/web/dist/assets/c-D2F1sQUL.js +2 -0
- package/packages/web/dist/assets/c4Diagram-AAUBKEIU-7e0TQtXB.js +11 -0
- package/packages/web/dist/assets/channel-C_1aISNn.js +2 -0
- package/packages/web/dist/assets/chunk-2J33WTMH-Dz4WZmUZ.js +2 -0
- package/packages/web/dist/assets/chunk-4BX2VUAB-DVWYldo6.js +2 -0
- package/packages/web/dist/assets/chunk-55IACEB6-BIMrizQd.js +2 -0
- package/packages/web/dist/assets/chunk-727SXJPM-CL2q9fF1.js +207 -0
- package/packages/web/dist/assets/chunk-AQP2D5EJ-BSq3HlQ9.js +232 -0
- package/packages/web/dist/assets/chunk-FMBD7UC4-Bgt64pLE.js +16 -0
- package/packages/web/dist/assets/chunk-ND2GUHAM-C8Pr2A38.js +2 -0
- package/packages/web/dist/assets/chunk-QZHKN3VN-BAOqh-MN.js +2 -0
- package/packages/web/dist/assets/classDiagram-4FO5ZUOK-B8JE7cHJ.js +2 -0
- package/packages/web/dist/assets/classDiagram-v2-Q7XG4LA2-B8JE7cHJ.js +2 -0
- package/packages/web/dist/assets/core-lJeGACQg.js +4 -0
- package/packages/web/dist/assets/cose-bilkent-S5V4N54A-BF4tameA.js +2 -0
- package/packages/web/dist/assets/cpp-Bm3ii6kY.js +2 -0
- package/packages/web/dist/assets/csharp-BNpuYZMG.js +2 -0
- package/packages/web/dist/assets/css-DazXZka4.js +2 -0
- package/packages/web/dist/assets/cytoscape.esm-CUqq0XTU.js +332 -0
- package/packages/web/dist/assets/dagre-BM42HDAG-DdsLM6ql.js +5 -0
- package/packages/web/dist/assets/defaultLocale-DX6XiGOO.js +2 -0
- package/packages/web/dist/assets/diagram-2AECGRRQ-BQ78S_RM.js +44 -0
- package/packages/web/dist/assets/diagram-5GNKFQAL-CAKE6nHE.js +11 -0
- package/packages/web/dist/assets/diagram-KO2AKTUF-fEvHRXgr.js +4 -0
- package/packages/web/dist/assets/diagram-LMA3HP47-CtWsgeSm.js +25 -0
- package/packages/web/dist/assets/diagram-OG6HWLK6-Buog8k7_.js +25 -0
- package/packages/web/dist/assets/erDiagram-TEJ5UH35-CWvVVPZS.js +86 -0
- package/packages/web/dist/assets/flowDiagram-I6XJVG4X-DsCGXtp4.js +163 -0
- package/packages/web/dist/assets/format-DamJQ9LO.js +2 -0
- package/packages/web/dist/assets/ganttDiagram-6RSMTGT7-CsdwIvvC.js +293 -0
- package/packages/web/dist/assets/gitGraphDiagram-PVQCEYII-hZvrX1sD.js +107 -0
- package/packages/web/dist/assets/go-BPx_y7j8.js +2 -0
- package/packages/web/dist/assets/graph-BlwPajkw.js +2 -0
- package/packages/web/dist/assets/index-CGbZdrm8.js +71 -0
- package/packages/web/dist/assets/index-DJDQ210-.css +1 -0
- package/packages/web/dist/assets/infoDiagram-5YYISTIA-nE_Vtz_l.js +3 -0
- package/packages/web/dist/assets/ini-B3BVgEsG.js +2 -0
- package/packages/web/dist/assets/init-Gi6I4Gst.js +2 -0
- package/packages/web/dist/assets/ishikawaDiagram-YF4QCWOH-2Nlqs0oH.js +71 -0
- package/packages/web/dist/assets/java-B5VKqtH2.js +2 -0
- package/packages/web/dist/assets/javascript-BKRaQes9.js +2 -0
- package/packages/web/dist/assets/journeyDiagram-JHISSGLW-mjU1fMc4.js +140 -0
- package/packages/web/dist/assets/json-DIYVocXf.js +2 -0
- package/packages/web/dist/assets/kanban-definition-UN3LZRKU-C_9xNaa3.js +90 -0
- package/packages/web/dist/assets/katex-C5jXJg4s.js +258 -0
- package/packages/web/dist/assets/kotlin-Cw-eF_bm.js +3 -0
- package/packages/web/dist/assets/lastTab-CU1zsF0j.js +2 -0
- package/packages/web/dist/assets/layout-Boy8vhSP.js +2 -0
- package/packages/web/dist/assets/linear-BxKd91ho.js +2 -0
- package/packages/web/dist/assets/mermaid.core-C-CuhD8I.js +310 -0
- package/packages/web/dist/assets/mindmap-definition-RKZ34NQL-Bs6yfcZv.js +97 -0
- package/packages/web/dist/assets/ordinal-Cboi1Yqb.js +2 -0
- package/packages/web/dist/assets/php-CRdd4dfS.js +3 -0
- package/packages/web/dist/assets/pieDiagram-4H26LBE5-DNdqX7O5.js +31 -0
- package/packages/web/dist/assets/python-kSlZHhJb.js +2 -0
- package/packages/web/dist/assets/quadrantDiagram-W4KKPZXB-ZMJl9OdZ.js +8 -0
- package/packages/web/dist/assets/queued-LamEU0GH.js +2 -0
- package/packages/web/dist/assets/requirementDiagram-4Y6WPE33-RmxMdm2q.js +85 -0
- package/packages/web/dist/assets/ruby-7T4ktxyv.js +2 -0
- package/packages/web/dist/assets/rust-HC3MBUhY.js +2 -0
- package/packages/web/dist/assets/sankeyDiagram-5OEKKPKP-OAAhWcfK.js +41 -0
- package/packages/web/dist/assets/scss-DZLA7YXz.js +2 -0
- package/packages/web/dist/assets/sequenceDiagram-3UESZ5HK-BWF7rCyN.js +163 -0
- package/packages/web/dist/assets/sql-BC88IN-V.js +2 -0
- package/packages/web/dist/assets/stateDiagram-AJRCARHV-M3b_zqqo.js +2 -0
- package/packages/web/dist/assets/stateDiagram-v2-BHNVJYJU-CI7saFDa.js +2 -0
- package/packages/web/dist/assets/swift-Dn8kKO_1.js +2 -0
- package/packages/web/dist/assets/timeline-definition-PNZ67QCA-BpOCh63N.js +121 -0
- package/packages/web/dist/assets/typescript-C2FFdlUC.js +2 -0
- package/packages/web/dist/assets/vennDiagram-CIIHVFJN-D_iPH45Q.js +35 -0
- package/packages/web/dist/assets/wardley-L42UT6IY-DVD9I2Om.js +174 -0
- package/packages/web/dist/assets/wardleyDiagram-YWT4CUSO-Bn1IKwjn.js +79 -0
- package/packages/web/dist/assets/xml-BXBhIUeX.js +2 -0
- package/packages/web/dist/assets/xychartDiagram-2RQKCTM6-DwtI0bkR.js +8 -0
- package/packages/web/dist/assets/yaml-drsDnIKT.js +2 -0
- package/packages/web/dist/favicon.ico +0 -0
- package/packages/web/dist/fonts/inter-latin.woff2 +0 -0
- package/packages/web/dist/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/packages/web/dist/icons/apple-touch-icon.png +0 -0
- package/packages/web/dist/icons/favicon-16.png +0 -0
- package/packages/web/dist/icons/favicon-32.png +0 -0
- package/packages/web/dist/icons/icon-192.png +0 -0
- package/packages/web/dist/icons/icon-512.png +0 -0
- package/packages/web/dist/icons/maskable-512.png +0 -0
- package/packages/web/dist/index.html +56 -0
- package/packages/web/dist/manifest.webmanifest +32 -0
- package/packages/web/dist/sw.js +139 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { IMAGE_MIME, VIDEO_MIME, DOCUMENT_MIME, fileKind, contentTypeFor } from "./project-mime.js";
|
|
2
|
+
export { IMAGE_MIME, VIDEO_MIME, DOCUMENT_MIME, fileKind, contentTypeFor };
|
|
3
|
+
import { ROOT_KEY, isRootKey, isValidRepoUrl, repoCheckoutName, workingDirFor, slugify, ProjectError } from "./project-paths.js";
|
|
4
|
+
export { ROOT_KEY, isRootKey, isValidRepoUrl, repoCheckoutName, workingDirFor, slugify, ProjectError, };
|
|
5
|
+
import { type Project, type FileKind, type FileEntry, type CreateProjectInput, type UpdateProjectInput } from "./project-types.js";
|
|
6
|
+
export * from "./project-types.js";
|
|
7
|
+
export declare class ProjectStore {
|
|
8
|
+
private readonly root;
|
|
9
|
+
constructor(root: string);
|
|
10
|
+
/** Ensure the projects root exists. Call once at startup. */
|
|
11
|
+
init(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* The on-disk directory backing a workspace key.
|
|
14
|
+
*
|
|
15
|
+
* A key is a path RELATIVE to `projectsRoot`, and the root workspace's key is
|
|
16
|
+
* `""` — so `path.join` resolves it with no special case at all. The previous
|
|
17
|
+
* design needed a branch here for a reserved slug, and that branch had to be
|
|
18
|
+
* duplicated in `project-files.ts` (where it was missed, 404ing every root
|
|
19
|
+
* file route). There is now no branch to forget.
|
|
20
|
+
*/
|
|
21
|
+
private dirFor;
|
|
22
|
+
/**
|
|
23
|
+
* Keep the root's `.chats/` out of the backing repo. Root chats are ordinary
|
|
24
|
+
* chats and get the same treatment project chats already do
|
|
25
|
+
* ({@link ensureSidecarGitignore}) — transcripts are append-heavy JSONL and are
|
|
26
|
+
* not tracked anywhere today.
|
|
27
|
+
*/
|
|
28
|
+
private ensureRootGitignore;
|
|
29
|
+
/** List all projects, newest-updated first. Skips `_`-prefixed dirs. */
|
|
30
|
+
list(): Promise<Project[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Get one workspace by key. Throws `ProjectError("not_found")` if missing.
|
|
33
|
+
*
|
|
34
|
+
* The root key (`""`) always resolves — the instance's own directory is always
|
|
35
|
+
* there — so this never throws for the root.
|
|
36
|
+
*/
|
|
37
|
+
get(slug: string): Promise<Project>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a workspace exists. For a project that means a `project.yaml`
|
|
40
|
+
* record; the root workspace always exists, record or not.
|
|
41
|
+
*/
|
|
42
|
+
exists(slug: string): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a project: mkdir + write project.yaml (from template) + seed
|
|
45
|
+
* CHANGELOG.md. Idempotency: throws ProjectError("exists") if the slug
|
|
46
|
+
* directory already holds a project.yaml.
|
|
47
|
+
*/
|
|
48
|
+
create(input: CreateProjectInput): Promise<Project>;
|
|
49
|
+
/**
|
|
50
|
+
* Promote an existing NOTEBOOK project into a REPO-BACKED one IN PLACE (issue
|
|
51
|
+
* #213), preserving its chats + sidecar metadata. This relaxes #187's create-time
|
|
52
|
+
* `repo` immutability on this ONE path: an existing project (a subdir of the data
|
|
53
|
+
* repo) gains an external git repo as its keeper's working directory.
|
|
54
|
+
*
|
|
55
|
+
* What it does (mirrors `create()`'s repo-backed branch, but non-destructively):
|
|
56
|
+
* 1. Clone the repo into the nested checkout `<dir>/<repo-name>/` — FIRST, so a
|
|
57
|
+
* clone failure rolls back (rm just the checkout) and leaves the notebook
|
|
58
|
+
* wholly intact (project.yaml, `.chats/`, OVERVIEW/CHANGELOG untouched).
|
|
59
|
+
* 2. Write the sidecar `.gitignore` (`/<repo-name>/` + `/.chats/`) so the
|
|
60
|
+
* checkout + transcript store stay out of the data repo.
|
|
61
|
+
* 3. Set `repo:` in project.yaml → the DTO flips to repo-backed and the keeper's
|
|
62
|
+
* cwd becomes the checkout ({@link workingDirFor}).
|
|
63
|
+
* 4. Drop the sweeper-owned per-project `CLAUDE.md`: a repo-backed project defers
|
|
64
|
+
* to the repo's OWN `CLAUDE.md` (loaded natively from the checkout). Leaving
|
|
65
|
+
* the notebook's would leak into the checkout's cwd walk-up (the metadata dir
|
|
66
|
+
* is an ancestor of the nested checkout) — so it's removed (it survives in the
|
|
67
|
+
* data repo's git history).
|
|
68
|
+
*
|
|
69
|
+
* The existing chats need NO transcript surgery: they already live in `<dir>/.chats/`;
|
|
70
|
+
* the caller's {@link import("./herdctl.js").HerdctlService.ensureProjectAgent} re-runs
|
|
71
|
+
* `ensureProjectChats(newWorkingDir, dir)` which re-symlinks the new cwd's encoded
|
|
72
|
+
* transcript path at that same `.chats/` store, so every chat stays listed + resumable
|
|
73
|
+
* (issue #213 open-question #1, resolved: Claude Code tolerates recorded-cwd ≠ process-cwd).
|
|
74
|
+
*
|
|
75
|
+
* Guards: throws `ProjectError("invalid")` for a not-yet-notebook (already
|
|
76
|
+
* repo-backed) project or a bad URL, and `ProjectError("exists")` if a
|
|
77
|
+
* `<repo-name>/` directory is already present (never clobber existing files).
|
|
78
|
+
*/
|
|
79
|
+
promote(slug: string, repoUrl: string): Promise<Project>;
|
|
80
|
+
/** Update mutable metadata fields and bump `updated`. */
|
|
81
|
+
update(slug: string, patch: UpdateProjectInput): Promise<Project>;
|
|
82
|
+
/** Read OVERVIEW.md, or "" if it doesn't exist yet. */
|
|
83
|
+
readOverview(slug: string): Promise<string>;
|
|
84
|
+
/** Replace OVERVIEW.md wholesale (the sweep regenerates it each time). */
|
|
85
|
+
writeOverview(slug: string, content: string): Promise<void>;
|
|
86
|
+
/** Read CHANGELOG.md, or "" if it doesn't exist yet (issue #188). */
|
|
87
|
+
readChangelog(slug: string): Promise<string>;
|
|
88
|
+
/** Whether OVERVIEW.md exists for this project. */
|
|
89
|
+
overviewExists(slug: string): Promise<boolean>;
|
|
90
|
+
/** Read CLAUDE.md, or "" if it doesn't exist yet (issue #177). */
|
|
91
|
+
readClaudeMd(slug: string): Promise<string>;
|
|
92
|
+
/**
|
|
93
|
+
* Replace the CLAUDE.md "Curated notes" section wholesale with a sweeper-
|
|
94
|
+
* curated body (issue #379), preserving ALL human-authored content above the
|
|
95
|
+
* managed heading. This supersedes the old amend-only `appendClaudeMd`, which
|
|
96
|
+
* blind-appended and could never dedup — the sweeper only ever saw the first
|
|
97
|
+
* 2000 chars of the file, so it re-added "known" facts believing they were new.
|
|
98
|
+
* The sweeper now sees the full file and returns the ENTIRE curated-notes body,
|
|
99
|
+
* dedup'd/pruned to fit its budget. Everything up to and including the
|
|
100
|
+
* `## Curated notes` heading is kept verbatim; only the body below is rewritten.
|
|
101
|
+
* The file/heading is seeded if absent (older projects predating #177). A blank
|
|
102
|
+
* body is a no-op — the caller passes content only when there's something to
|
|
103
|
+
* write (NOCHANGE means "leave the file untouched", not "empty it").
|
|
104
|
+
*/
|
|
105
|
+
writeClaudeCurated(slug: string, curatedBody: string): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Pin a file: validate it exists in the project dir, dedupe, persist in
|
|
108
|
+
* project.yaml. Returns the updated project. Throws ProjectError("invalid")
|
|
109
|
+
* if the file doesn't exist or escapes the project dir.
|
|
110
|
+
*/
|
|
111
|
+
pinFile(slug: string, file: string): Promise<Project>;
|
|
112
|
+
/** Unpin a file (no-op if not pinned). Returns the updated project. */
|
|
113
|
+
unpinFile(slug: string, file: string): Promise<Project>;
|
|
114
|
+
/**
|
|
115
|
+
* Add or replace one unified trigger in `project.yaml`, keyed by name (Epic T /
|
|
116
|
+
* T1) — the persistence half of a trigger mutation (the caller arms it against
|
|
117
|
+
* herdctl separately via `TriggerService`/`HerdctlService`). The record is validated
|
|
118
|
+
* + normalised by the Zod schema ({@link sanitizeTrigger}); an invalid name or record
|
|
119
|
+
* throws `ProjectError("invalid")`. Returns the updated project DTO.
|
|
120
|
+
*/
|
|
121
|
+
setTrigger(slug: string, name: string, trigger: unknown): Promise<Project>;
|
|
122
|
+
/**
|
|
123
|
+
* Remove a trigger from `project.yaml` (no-op if absent). Returns the updated
|
|
124
|
+
* project DTO. The caller disarms the trigger's agent / schedule via `TriggerService`.
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
removeTrigger(slug: string, name: string): Promise<Project>;
|
|
128
|
+
/**
|
|
129
|
+
* Delete a project directory and everything in it (project.yaml, CHANGELOG.md,
|
|
130
|
+
* and any files the keeper agent created). Throws ProjectError("not_found")
|
|
131
|
+
* if the slug has no project.yaml, so callers can return a clean 404.
|
|
132
|
+
*
|
|
133
|
+
* Note: this removes the project DIRECTORY only. The caller (server) is
|
|
134
|
+
* responsible for dropping the generated keeper-agent yaml + regenerating
|
|
135
|
+
* herdctl.yaml + reloading the fleet — the inverse of the create flow.
|
|
136
|
+
*/
|
|
137
|
+
remove(slug: string): Promise<Project>;
|
|
138
|
+
/**
|
|
139
|
+
* Replace CHANGELOG.md wholesale with a sweeper-curated body (issue #379). The
|
|
140
|
+
* sweeper now returns the FULL changelog — adding a dated entry for genuinely-
|
|
141
|
+
* new activity, coalescing duplicates, and dropping/summarizing the oldest to
|
|
142
|
+
* stay under its token budget — instead of one blind-appended bullet. That's
|
|
143
|
+
* what stops the file (and the per-chat preload that injects it) growing without
|
|
144
|
+
* bound. The `# Changelog — <slug>` title is owned by Paddock and re-asserted
|
|
145
|
+
* here so the model never has to reproduce it; if the model included its own
|
|
146
|
+
* top-level heading we drop it to avoid a duplicate title. A blank body is a
|
|
147
|
+
* no-op (guards against wiping the file on a malformed reply).
|
|
148
|
+
*/
|
|
149
|
+
writeChangelog(slug: string, body: string): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* List one level of a project directory (issue #259). See
|
|
152
|
+
* {@link import("./project-files.js").listFiles}.
|
|
153
|
+
*/
|
|
154
|
+
listFiles(slug: string, subpath?: string): Promise<FileEntry[]>;
|
|
155
|
+
/** Read a freeform file's contents as UTF-8 text (path-traversal guarded). */
|
|
156
|
+
readFile(slug: string, name: string): Promise<string>;
|
|
157
|
+
/**
|
|
158
|
+
* Read a file's raw bytes + its MIME type (issue #61), for the binary/image
|
|
159
|
+
* endpoint. See {@link import("./project-files.js").readFileBytes}.
|
|
160
|
+
*/
|
|
161
|
+
readFileBytes(slug: string, name: string): Promise<{
|
|
162
|
+
bytes: Buffer;
|
|
163
|
+
mime: string;
|
|
164
|
+
}>;
|
|
165
|
+
/**
|
|
166
|
+
* Read a file plus a render-kind hint derived from its extension (issues #3 /
|
|
167
|
+
* #61). See {@link import("./project-files.js").readFileWithKind}.
|
|
168
|
+
*/
|
|
169
|
+
readFileWithKind(slug: string, name: string): Promise<{
|
|
170
|
+
name: string;
|
|
171
|
+
kind: FileKind;
|
|
172
|
+
content: string;
|
|
173
|
+
}>;
|
|
174
|
+
/**
|
|
175
|
+
* Read one workspace, or `null` if the key doesn't name one.
|
|
176
|
+
*
|
|
177
|
+
* **The root workspace always exists.** For a project, `project.yaml` IS the
|
|
178
|
+
* existence gate — no record, not a project. But the root is the instance
|
|
179
|
+
* itself: its directory is always there, so a missing record just means
|
|
180
|
+
* "nothing has been customised yet" and every field falls back to a default
|
|
181
|
+
* (see {@link normalize}). The record is written lazily, on the first setting
|
|
182
|
+
* that actually changes.
|
|
183
|
+
*
|
|
184
|
+
* This is what removes the whole opt-in apparatus the previous design needed —
|
|
185
|
+
* no `createRoot`, no enable card, and no `/chat` that 404s on a fresh box.
|
|
186
|
+
*/
|
|
187
|
+
private readSafe;
|
|
188
|
+
/** Fill defaults / coerce a parsed project.yaml into a complete ProjectYaml. */
|
|
189
|
+
private normalize;
|
|
190
|
+
/**
|
|
191
|
+
* Ensure the project dir's sidecar `.gitignore` ignores the nested repo-backed
|
|
192
|
+
* checkout (`/<checkoutName>/`) and the transcript store (`/.chats/`), so neither
|
|
193
|
+
* is tracked by the instance data repo (issue #187 option A). Idempotent and
|
|
194
|
+
* merge-aware: an existing `.gitignore` (rare for a notebook, but possible) keeps
|
|
195
|
+
* its lines and only the missing entries are appended — used by both `create()`
|
|
196
|
+
* and the in-place `promote()` (#213).
|
|
197
|
+
*/
|
|
198
|
+
private ensureSidecarGitignore;
|
|
199
|
+
private writeYaml;
|
|
200
|
+
private toDto;
|
|
201
|
+
private stripDto;
|
|
202
|
+
}
|