deep-projects 0.4.1 → 0.4.3

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 (3) hide show
  1. package/README.md +4 -1
  2. package/lib/client.js +174 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  <a href="https://www.npmjs.com/package/deep-projects"><img src="https://img.shields.io/npm/dm/deep-projects?color=4d6bfe" alt="npm downloads"></a>
8
8
  <img src="https://img.shields.io/badge/dependencies-0-4d6bfe" alt="zero runtime dependencies">
9
9
  <a href="https://github.com/JoblessJoe/deep-projects/blob/main/LICENSE"><img src="https://img.shields.io/github/license/JoblessJoe/deep-projects?color=4d6bfe" alt="MIT license"></a>
10
+ <a href="https://joblessjoe.com/deep-projects"><img src="https://img.shields.io/badge/website-joblessjoe.com-4d6bfe" alt="project page on joblessjoe.com"></a>
10
11
  <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/topic-dsh--plugin-0b6bcb" alt="dsh-plugin topic"></a>
11
12
  </p>
12
13
 
@@ -105,7 +106,9 @@ npx @deepseek-ai/dsh plugin --profile web add file:/path/to/deep-projects
105
106
 
106
107
  On stock dsh, pinned projects show up as plain sidebar rows that open the project. dsh has no plugin seat yet for a block between the panel rows and the workspace list, so the expandable version (arrow, chats underneath, "…" menu right in the sidebar) needs a small `ui-sidebar` patch: [`patches/ui-sidebar-projects-seat.patch`](https://github.com/JoblessJoe/deep-projects/blob/main/patches/ui-sidebar-projects-seat.patch). With it applied, the plugin switches to that view by itself. Everything else works without it.
107
108
 
108
- **Let your agent do it:** give your coding agent [`patches/AGENT-INSTRUCTIONS.md`](https://github.com/JoblessJoe/deep-projects/blob/main/patches/AGENT-INSTRUCTIONS.md). It checks your dsh version, applies the patch, rebuilds the sidebar package and tells you when to restart. The patch needs a dsh source checkout; it can't be applied to an npm-installed dsh.
109
+ A second small patch, [`patches/ui-conversation-cwd-hero.patch`](https://github.com/JoblessJoe/deep-projects/blob/main/patches/ui-conversation-cwd-hero.patch), gives project chats dsh's full input on the new chat screen. Stock dsh locks that input for chats outside a workspace, so without the patch the plugin shows its own simple box for the first message. I've [asked dsh](https://github.com/deepseek-ai/deepseek-harness/discussions/14029) to drop the lock.
110
+
111
+ **Let your agent do it:** give your coding agent [`patches/AGENT-INSTRUCTIONS.md`](https://github.com/JoblessJoe/deep-projects/blob/main/patches/AGENT-INSTRUCTIONS.md). It checks your dsh version, applies the patches, rebuilds the changed packages and tells you when to restart. The patch needs a dsh source checkout; it can't be applied to an npm-installed dsh.
109
112
 
110
113
  ## Develop
111
114
 
package/lib/client.js CHANGED
@@ -38,6 +38,11 @@ var en = {
38
38
  "tab.project": "Project",
39
39
  "tab.project.hint": "Memories, instructions, and knowledge for this project \u2014 the agent loads them in every chat that opens here.",
40
40
  "header.open": "Project info",
41
+ "hero.project": "Project",
42
+ "stock.placeholder": "Start a chat in this project\u2026",
43
+ "stock.hint": "Enter to send \xB7 Shift+Enter for a new line",
44
+ "stock.send": "Send",
45
+ "stock.failed": "Could not send the message.",
41
46
  "tree.title": "Projects",
42
47
  "tree.search": "Filter projects\u2026",
43
48
  "tree.collapse": "Collapse",
@@ -134,6 +139,11 @@ var zh = {
134
139
  "tab.project": "\u9879\u76EE",
135
140
  "tab.project.hint": "\u672C\u9879\u76EE\u7684\u8BB0\u5FC6\u3001\u6307\u4EE4\u4E0E\u77E5\u8BC6\u6587\u4EF6\u2014\u2014\u5728\u6B64\u6253\u5F00\u7684\u6BCF\u6B21\u804A\u5929\u90FD\u4F1A\u81EA\u52A8\u52A0\u8F7D\u3002",
136
141
  "header.open": "\u9879\u76EE\u4FE1\u606F",
142
+ "hero.project": "\u9879\u76EE",
143
+ "stock.placeholder": "\u5728\u6B64\u9879\u76EE\u4E2D\u5F00\u59CB\u5BF9\u8BDD\u2026",
144
+ "stock.hint": "Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C",
145
+ "stock.send": "\u53D1\u9001",
146
+ "stock.failed": "\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002",
137
147
  "empty.title": "\u8FD8\u6CA1\u6709\u9879\u76EE",
138
148
  "empty.hint": "\u521B\u5EFA\u4E00\u4E2A\u9879\u76EE\uFF0C\u628A\u804A\u5929\u3001\u6307\u4EE4\u548C\u77E5\u8BC6\u6587\u4EF6\u5F52\u5230\u540C\u4E00\u4E2A\u5DE5\u4F5C\u533A\u3002",
139
149
  "create.title": "\u65B0\u5EFA\u9879\u76EE",
@@ -195,7 +205,7 @@ var CSS = `
195
205
  --dshpx-hover: var(--dsw-alias-interactive-bg-hover, var(--dsw-alias-bg-skeleton));
196
206
  font-family: inherit; color: var(--dsw-alias-label-primary);
197
207
  }
198
- .dshpx-side, .dshpx-tabpane { --dshpx-line: color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);
208
+ .dshpx-side, .dshpx-tabpane, .dshpx-stock-composer { --dshpx-line: color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);
199
209
  --dshpx-fill: var(--dsw-alias-bg-skeleton); --dshpx-hover: var(--dsw-alias-interactive-bg-hover, var(--dsw-alias-bg-skeleton)); }
200
210
  .dshpx-split { display: flex; width: 100%; height: 100%; min-height: 0; }
201
211
  .dshpx-root svg, .dshpx-side svg, .dshpx-tabpane svg, .dshpx-header-btn svg { fill: currentColor; }
@@ -445,6 +455,29 @@ var CSS = `
445
455
  .dshpx-tabpane .dshpx-grid { gap: 14px; }
446
456
  .dshpx-tabpane .dshpx-h1 { font-size: 20px; }
447
457
  .dshpx-tabpane .dshpx-card { padding: 14px 16px; }
458
+ /* Seat the hero options (our Project chip) right after the workspace chip. */
459
+ :has(> [data-slot="conversation.hero.options"] .dshpx-hero-chip) { order: 1; margin-left: 0 !important; }
460
+ [data-slot="conversation.hero.agentPreset"] > * { order: 2; }
461
+ .dshpx-hero-chip {
462
+ display: inline-flex; align-items: center; gap: 4px; max-width: 200px;
463
+ background: transparent; border: none; border-radius: 6px; padding: 4px 6px; cursor: pointer;
464
+ font: inherit; font-size: 13px; color: var(--dsw-alias-label-primary); transition: background 120ms ease, color 120ms ease;
465
+ }
466
+ .dshpx-hero-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
467
+ .dshpx-hero-chip:hover { background: var(--dsw-alias-interactive-bg-hover); }
468
+ .dshpx-hero-chip svg { fill: currentColor; flex: none; }
469
+ .dshpx-stock-composer {
470
+ display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; width: 100%; max-width: 720px; margin: 0 auto;
471
+ border: 1px solid var(--dshpx-line); border-radius: 16px; padding: 12px 14px; background: var(--dsw-alias-bg-base);
472
+ }
473
+ .dshpx-stock-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dsw-alias-label-caption); }
474
+ .dshpx-stock-head svg { fill: currentColor; }
475
+ .dshpx-stock-composer textarea {
476
+ resize: none; border: none; outline: none; background: transparent; font: inherit; font-size: 14px;
477
+ color: var(--dsw-alias-label-primary);
478
+ }
479
+ .dshpx-stock-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--dsw-alias-label-tertiary); }
480
+ .dshpx-stock-err { color: var(--dsw-alias-state-error-primary); }
448
481
  .dshpx-header-btn {
449
482
  display: inline-flex; align-items: center; justify-content: center;
450
483
  background: transparent; border: none; border-radius: 6px; padding: 4px; cursor: pointer;
@@ -973,6 +1006,120 @@ function DetailPane({ t, slug }) {
973
1006
  }
974
1007
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectContent, { t, slug });
975
1008
  }
1009
+ function HeroProjectPicker(props) {
1010
+ const t = props.t;
1011
+ const { sessionId, useSessions } = props;
1012
+ const cwd = useSessions((s) => {
1013
+ var _a;
1014
+ return (_a = s.byId[sessionId]) == null ? void 0 : _a.cwd;
1015
+ });
1016
+ const [rows, setRows] = (0, import_react.useState)([]);
1017
+ const load = (0, import_react.useCallback)(() => {
1018
+ getJson("list").then((r) => {
1019
+ var _a;
1020
+ setRows((r == null ? void 0 : r.ok) ? (_a = r.projects) != null ? _a : [] : []);
1021
+ }).catch(() => {
1022
+ setRows([]);
1023
+ });
1024
+ }, []);
1025
+ (0, import_react.useEffect)(load, [load]);
1026
+ useOnChanged(load);
1027
+ const live = rows.filter((r) => r.path && !r.archived);
1028
+ if (live.length === 0) return null;
1029
+ const current = live.find((r) => cwd === r.path || (cwd != null ? cwd : "").startsWith(r.path + "/"));
1030
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1031
+ "button",
1032
+ {
1033
+ className: "dshpx-hero-chip",
1034
+ type: "button",
1035
+ "data-active": current ? "true" : void 0,
1036
+ onClick: (e) => {
1037
+ toggleMenu("dsh-project-picker", { projects: live, current: current == null ? void 0 : current.slug }, () => true, pointOf(e));
1038
+ },
1039
+ children: [
1040
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconFolderCloseRegular, { width: 14, height: 14 }),
1041
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: current ? current.name : t("hero.project") }),
1042
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { width: 12, height: 12 })
1043
+ ]
1044
+ }
1045
+ );
1046
+ }
1047
+ var heroPatched = false;
1048
+ try {
1049
+ localStorage.removeItem("deep-projects:heroPatched");
1050
+ } catch {
1051
+ }
1052
+ function selectStockProjectComposer(owner) {
1053
+ var _a, _b, _c, _d;
1054
+ const sid = owner.sessionId;
1055
+ if (heroPatched || !sid || ((_a = owner.session) == null ? void 0 : _a.blank) !== true || !appCtx) return null;
1056
+ const cwd = (_c = (_b = appCtx.get("sessions")) == null ? void 0 : _b.list.getSnapshot().byId[sid]) == null ? void 0 : _c.cwd;
1057
+ const ws = (_d = appCtx.get("workspaces")) == null ? void 0 : _d.list.getSnapshot();
1058
+ if (!cwd || (ws == null ? void 0 : ws.phase) !== "ready") return null;
1059
+ if (ws.items.some((w) => w.sessionIds.includes(sid))) return null;
1060
+ return { cwd };
1061
+ }
1062
+ function StockProjectComposer(props) {
1063
+ var _a;
1064
+ const { matched, sessionId, t } = props;
1065
+ const [text, setText] = (0, import_react.useState)("");
1066
+ const [busy, setBusy] = (0, import_react.useState)(false);
1067
+ const [error, setError] = (0, import_react.useState)(null);
1068
+ (0, import_react.useEffect)(() => {
1069
+ var _a2;
1070
+ const ed = document.querySelector("[data-composer-seat] [contenteditable]");
1071
+ if ((ed == null ? void 0 : ed.getAttribute("contenteditable")) !== "true" || !sessionId) return;
1072
+ heroPatched = true;
1073
+ void ((_a2 = appCtx == null ? void 0 : appCtx.get("sessions")) == null ? void 0 : _a2.refreshProjections(sessionId));
1074
+ }, [sessionId]);
1075
+ const send = async () => {
1076
+ var _a2, _b, _c, _d;
1077
+ const body = text.trim();
1078
+ if (!body || !sessionId || busy) return;
1079
+ const session = (_b = (_a2 = appCtx == null ? void 0 : appCtx.get("sessions")) == null ? void 0 : _a2.binding(sessionId)) == null ? void 0 : _b.session;
1080
+ if (!session) {
1081
+ setError(t("stock.failed"));
1082
+ return;
1083
+ }
1084
+ setBusy(true);
1085
+ setError(null);
1086
+ const r = await session.prompt([{ type: "text", text: body }], "queue").catch((e) => ({ ok: false, error: { message: String(e) } }));
1087
+ setBusy(false);
1088
+ if (r == null ? void 0 : r.ok) setText("");
1089
+ else setError((_d = (_c = r == null ? void 0 : r.error) == null ? void 0 : _c.message) != null ? _d : t("stock.failed"));
1090
+ };
1091
+ const name = (_a = matched.cwd.split("/").filter(Boolean).pop()) != null ? _a : matched.cwd;
1092
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshpx-stock-composer", children: [
1093
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshpx-stock-head", children: [
1094
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconFolderCloseRegular, { width: 14, height: 14 }),
1095
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: name })
1096
+ ] }),
1097
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1098
+ "textarea",
1099
+ {
1100
+ value: text,
1101
+ rows: 3,
1102
+ disabled: busy,
1103
+ placeholder: t("stock.placeholder"),
1104
+ onChange: (e) => {
1105
+ setText(e.target.value);
1106
+ },
1107
+ onKeyDown: (e) => {
1108
+ if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
1109
+ e.preventDefault();
1110
+ void send();
1111
+ }
1112
+ }
1113
+ }
1114
+ ),
1115
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshpx-stock-foot", children: [
1116
+ error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshpx-stock-err", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("stock.hint") }),
1117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "dshpx-btn dshpx-btn-primary dshpx-btn-sm", type: "button", disabled: busy || !text.trim(), onClick: () => {
1118
+ void send();
1119
+ }, children: t("stock.send") })
1120
+ ] })
1121
+ ] });
1122
+ }
976
1123
  function ProjectHeaderButton(props) {
977
1124
  const t = props.t;
978
1125
  const { sessionId, useSessions } = props;
@@ -1512,6 +1659,32 @@ function apply(ctx) {
1512
1659
  }
1513
1660
  ]
1514
1661
  }), "deep-projects: project menu");
1662
+ ctx.effect(() => ctx.contextMenus.register({
1663
+ id: "deep-projects.picker",
1664
+ target: "dsh-project-picker",
1665
+ order: 100,
1666
+ resolve: (v) => [...v.projects].sort((a, b) => Number(!!b.starred) - Number(!!a.starred)).map((p) => ({
1667
+ id: p.slug,
1668
+ label: p.name,
1669
+ icon: { key: p.slug === v.current ? "deep-projects.open" : "deep-projects.newChat" },
1670
+ disabled: p.slug === v.current,
1671
+ run: () => {
1672
+ if (p.path) void startProjectChat(p.path);
1673
+ }
1674
+ }))
1675
+ }), "deep-projects: hero picker menu");
1676
+ ctx.effect(() => {
1677
+ ctx.slots.inject(
1678
+ "conversation.hero.options",
1679
+ () => ctx.slots.register({ name: "conversation.hero.options", id: "deep-projects.picker", locale: "projects" }, HeroProjectPicker)
1680
+ );
1681
+ }, "deep-projects: hero picker");
1682
+ ctx.effect(() => {
1683
+ ctx.slots.inject(
1684
+ "conversation.composer",
1685
+ () => ctx.slots.register({ name: "conversation.composer", priority: -5, locale: "projects", select: selectStockProjectComposer }, StockProjectComposer)
1686
+ );
1687
+ }, "deep-projects: stock composer");
1515
1688
  ctx.effect(() => {
1516
1689
  ctx.slots.inject(
1517
1690
  "sidebar.panellist",
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "deep-projects",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Claude-Desktop-style Projects for DeepSeek Harness (dsh): named rooms in the sidebar, each with a goal, custom instructions, knowledge files and a memory your agents keep up to date, so you never explain a project twice.",
5
5
  "icon": "./icon.svg",
6
- "homepage": "https://github.com/JoblessJoe/deep-projects#readme",
6
+ "homepage": "https://joblessjoe.com/deep-projects",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/JoblessJoe/deep-projects.git"