dsh-plugin-core-demo 0.30.0 → 0.30.2

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 (2) hide show
  1. package/dist/client.js +151 -38
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -607,6 +607,7 @@ var DICT = {
607
607
  forkConfirmAccept: "\u5F00\u5206\u652F\u5E76\u8DF3\u8F6C",
608
608
  forkWorking: "\u6B63\u5728\u5F00\u5206\u652F\u2026",
609
609
  forkFailed: "\u5F00\u5206\u652F\u5931\u8D25\uFF1A{error}",
610
+ forkUnavailable: "\u5F00\u5206\u652F\u80FD\u529B\u672A\u5C31\u4F4D\uFF1A\u8C03\u7528\u65B9\u6CA1\u6709\u63D0\u4F9B forkSession\uFF0C\u65E0\u6CD5\u7EE7\u7EED\u5BF9\u8BDD\u3002",
610
611
  deliverRowTitle: "\u4EA4\u4ED8\u6587\u4EF6",
611
612
  deliverRowPreparing: "\u51C6\u5907\u4EA4\u4ED8",
612
613
  deliverRowRunning: "\u6B63\u5728\u4EA4\u4ED8",
@@ -1115,6 +1116,7 @@ var DICT = {
1115
1116
  forkConfirmAccept: "Fork & open",
1116
1117
  forkWorking: "Forking\u2026",
1117
1118
  forkFailed: "Fork failed: {error}",
1119
+ forkUnavailable: "Fork capability unavailable: the caller did not provide forkSession, so this conversation cannot be continued.",
1118
1120
  deliverRowTitle: "Present files",
1119
1121
  deliverRowPreparing: "Preparing deliverables",
1120
1122
  deliverRowRunning: "Delivering",
@@ -7806,7 +7808,7 @@ function createToasterHost() {
7806
7808
  fontWeight: 700
7807
7809
  }
7808
7810
  }, palette.glyph), (0, import_react32.createElement)("div", { style: { flex: 1, minWidth: 0 } }, (0, import_react32.createElement)("div", { style: { fontWeight: 600 } }, payload.message), payload.description !== void 0 ? (0, import_react32.createElement)("div", { style: { opacity: 0.9, fontSize: "13px", marginTop: "2px", whiteSpace: "pre-line" } }, payload.description) : null), actions2 !== void 0 && actions2.length > 0 ? (0, import_react32.createElement)("div", { style: { display: "flex", gap: "8px", flexShrink: 0 } }, ...actions2.slice(0, 2).map((a) => (0, import_react32.createElement)(Button, {
7809
- variant: a.variant ?? "outline",
7811
+ variant: a.variant ?? "info",
7810
7812
  size: "md",
7811
7813
  onClick: () => {
7812
7814
  a.onClick();
@@ -59846,6 +59848,95 @@ function pendingFiles(item) {
59846
59848
  }
59847
59849
  return out;
59848
59850
  }
59851
+ var EMPTY_FILES = [];
59852
+ function inboxUserMessages(inbox) {
59853
+ if (typeof inbox !== "object" || inbox === null)
59854
+ return [];
59855
+ const rec = inbox;
59856
+ const out = [];
59857
+ for (const target of ["next-turn", "next-step"]) {
59858
+ const list = rec[target];
59859
+ if (!Array.isArray(list))
59860
+ continue;
59861
+ for (const item of list) {
59862
+ if (typeof item !== "object" || item === null)
59863
+ continue;
59864
+ const msg = item;
59865
+ if (msg.source?.kind !== "user")
59866
+ continue;
59867
+ out.push(msg);
59868
+ }
59869
+ }
59870
+ return out;
59871
+ }
59872
+ function inboxContent(msg) {
59873
+ if (!Array.isArray(msg.content))
59874
+ return { text: "", files: EMPTY_FILES };
59875
+ const texts = [];
59876
+ const files = [];
59877
+ for (const block2 of msg.content) {
59878
+ if (typeof block2 !== "object" || block2 === null)
59879
+ continue;
59880
+ const part = block2;
59881
+ if (part.type === "text" && typeof part.text === "string") {
59882
+ texts.push(part.text);
59883
+ continue;
59884
+ }
59885
+ if (part.type !== "image" && part.type !== "file")
59886
+ continue;
59887
+ if (typeof part.attachment !== "object" || part.attachment === null)
59888
+ continue;
59889
+ const value = part.attachment;
59890
+ if (typeof value.name !== "string" || value.name === "")
59891
+ continue;
59892
+ files.push({ name: value.name, bytes: typeof value.bytes === "number" ? value.bytes : 0 });
59893
+ }
59894
+ return { text: texts.join(""), files };
59895
+ }
59896
+ function fromSubmission(item) {
59897
+ return {
59898
+ key: item.requestId,
59899
+ text: item.text ?? "",
59900
+ files: pendingFiles(item),
59901
+ pending: item.placement === "steering",
59902
+ echo: item.placement !== "steering"
59903
+ };
59904
+ }
59905
+ function waitingUserRows(inbox, pending, observed) {
59906
+ const local = new Map(visiblePendingInputs(pending, observed).map((item) => [item.requestId, item]));
59907
+ const rows = [];
59908
+ const messages = inboxUserMessages(inbox);
59909
+ for (const [i2, msg] of messages.entries()) {
59910
+ const rpcId = msg.source?.rpcId;
59911
+ if (rpcId !== void 0) {
59912
+ const echo = local.get(rpcId);
59913
+ if (echo !== void 0) {
59914
+ rows.push(fromSubmission(echo));
59915
+ local.delete(rpcId);
59916
+ continue;
59917
+ }
59918
+ if (observed.has(rpcId))
59919
+ continue;
59920
+ }
59921
+ const content2 = inboxContent(msg);
59922
+ if (content2.text === "" && content2.files.length === 0)
59923
+ continue;
59924
+ rows.push({
59925
+ key: msg.id ?? `inbox-${String(i2)}`,
59926
+ text: content2.text,
59927
+ files: content2.files,
59928
+ pending: true,
59929
+ echo: false
59930
+ });
59931
+ }
59932
+ for (const item of local.values()) {
59933
+ const row = fromSubmission(item);
59934
+ if (row.text === "" && row.files.length === 0)
59935
+ continue;
59936
+ rows.push(row);
59937
+ }
59938
+ return rows;
59939
+ }
59849
59940
 
59850
59941
  // dist/session/tail-follow.js
59851
59942
  var TAIL_NEAR_BOTTOM_PX = 24;
@@ -59936,6 +60027,7 @@ function createTailFollower(host) {
59936
60027
  // dist/session/SessionViewModal.js
59937
60028
  var EMPTY_ORDER = [];
59938
60029
  var NOT_ARCHIVED = () => false;
60030
+ var NO_INBOX = () => void 0;
59939
60031
  var officialWarned = false;
59940
60032
  function safeJson(value) {
59941
60033
  try {
@@ -60437,6 +60529,9 @@ function SessionViewModal(props) {
60437
60529
  const sessionSub = (0, import_react82.useMemo)(() => (onChange) => view.session.subscribe(onChange), [view]);
60438
60530
  const sessionGet = (0, import_react82.useMemo)(() => () => view.session.getSnapshot(), [view]);
60439
60531
  const sessionSnap = (0, import_react82.useSyncExternalStore)(sessionSub, sessionGet);
60532
+ const inboxSub = (0, import_react82.useMemo)(() => (onChange) => view.inbox.subscribe(onChange), [view]);
60533
+ const inboxGet = (0, import_react82.useMemo)(() => () => view.inbox.getSnapshot(), [view]);
60534
+ const inboxSnap = (0, import_react82.useSyncExternalStore)(inboxSub, inboxGet, NO_INBOX);
60440
60535
  const [openTurns, setOpenTurns] = (0, import_react82.useState)(() => /* @__PURE__ */ new Map());
60441
60536
  const onSetOpen = (0, import_react82.useCallback)((turn, answerStep, open) => {
60442
60537
  setOpenTurns((prev) => {
@@ -60449,8 +60544,7 @@ function SessionViewModal(props) {
60449
60544
  });
60450
60545
  }, []);
60451
60546
  const canFork = forkSession !== void 0 && openHostSession !== void 0;
60452
- const canDirectOpen = openHostSession !== void 0;
60453
- const showContinue = isArchived ? canFork : canDirectOpen;
60547
+ const showContinue = openHostSession !== void 0;
60454
60548
  const [forkTarget, setForkTarget] = (0, import_react82.useState)(null);
60455
60549
  const [forking, setForking] = (0, import_react82.useState)(false);
60456
60550
  const [forkErr, setForkErr] = (0, import_react82.useState)(null);
@@ -60500,7 +60594,7 @@ function SessionViewModal(props) {
60500
60594
  return;
60501
60595
  }
60502
60596
  tailRef.current?.content();
60503
- }, [chat, sessionSnap]);
60597
+ }, [chat, sessionSnap, inboxSnap]);
60504
60598
  const onForkAccept = (0, import_react82.useCallback)(() => {
60505
60599
  if (forking || forkSession === void 0 || openHostSession === void 0)
60506
60600
  return;
@@ -60560,22 +60654,15 @@ function SessionViewModal(props) {
60560
60654
  const keyed = order.length > 0 && store !== void 0;
60561
60655
  const turns = chat?.timeline?.turns;
60562
60656
  const observedRpc = (0, import_react82.useMemo)(() => keyed && store !== void 0 ? observedRpcIds(order, (key) => store.get(key)) : /* @__PURE__ */ new Set(), [keyed, order, store]);
60563
- const pendingInputs = (0, import_react82.useMemo)(() => visiblePendingInputs(sessionSnap?.pendingSubmissions, observedRpc), [sessionSnap, observedRpc]);
60564
- const pendingRows = [];
60565
- for (const item of pendingInputs) {
60566
- const text2 = item.text ?? "";
60567
- const files = pendingFiles(item);
60568
- if (text2 === "" && files.length === 0)
60569
- continue;
60570
- pendingRows.push((0, import_react82.createElement)(UserMessage, {
60571
- key: item.requestId,
60572
- text: text2,
60573
- files,
60574
- pending: item.placement === "steering",
60575
- echo: item.placement !== "steering",
60576
- t: tt
60577
- }));
60578
- }
60657
+ const waitingRows = (0, import_react82.useMemo)(() => waitingUserRows(inboxSnap, sessionSnap?.pendingSubmissions, observedRpc), [inboxSnap, sessionSnap, observedRpc]);
60658
+ const pendingRows = waitingRows.map((row) => (0, import_react82.createElement)(UserMessage, {
60659
+ key: row.key,
60660
+ text: row.text,
60661
+ files: row.files,
60662
+ pending: row.pending,
60663
+ echo: row.echo,
60664
+ t: tt
60665
+ }));
60579
60666
  const fileOpen = (0, import_react82.useMemo)(() => {
60580
60667
  if (onOpenFile === void 0)
60581
60668
  return void 0;
@@ -60816,9 +60903,9 @@ function SessionViewModal(props) {
60816
60903
  (0, import_react82.createElement)(Button, { key: "cancel", variant: "outline", disabled: forking, onClick: () => {
60817
60904
  setForkTarget(null);
60818
60905
  } }, tt("cancel")),
60819
- (0, import_react82.createElement)(Button, { key: "accept", variant: "primary", disabled: forking, onClick: onForkAccept }, forking ? tt("forkWorking") : tt("forkConfirmAccept"))
60906
+ (0, import_react82.createElement)(Button, { key: "accept", variant: "primary", disabled: forking || !canFork, onClick: onForkAccept }, forking ? tt("forkWorking") : tt("forkConfirmAccept"))
60820
60907
  ]
60821
- }, (0, import_react82.createElement)("p", { className: "dshpc-sv-forktext" }, tt("forkConfirmText")), forkErr !== null ? (0, import_react82.createElement)("p", { className: "dshpc-sv-forkerr" }, tt("forkFailed", { error: forkErr })) : null)
60908
+ }, (0, import_react82.createElement)("p", { className: "dshpc-sv-forktext" }, tt("forkConfirmText")), canFork ? null : (0, import_react82.createElement)("p", { className: "dshpc-sv-forkerr" }, tt("forkUnavailable")), forkErr !== null ? (0, import_react82.createElement)("p", { className: "dshpc-sv-forkerr" }, tt("forkFailed", { error: forkErr })) : null)
60822
60909
  );
60823
60910
  }
60824
60911
 
@@ -60847,6 +60934,12 @@ function openSessionReview(options) {
60847
60934
 
60848
60935
  // dist/session/open-session-view.js
60849
60936
  var DEFAULT_RETAIN_SOURCE = "dsh-plugin-core";
60937
+ var NOOP_DISPOSE = () => {
60938
+ };
60939
+ var EMPTY_INBOX_FACE = {
60940
+ getSnapshot: () => void 0,
60941
+ subscribe: () => NOOP_DISPOSE
60942
+ };
60850
60943
  function openSessionView(sessions, uiConversation, id3, retainSource = DEFAULT_RETAIN_SOURCE) {
60851
60944
  const log = (level, msg, extra) => {
60852
60945
  if (level === "warn")
@@ -60904,6 +60997,8 @@ function openSessionView(sessions, uiConversation, id3, retainSource = DEFAULT_R
60904
60997
  return null;
60905
60998
  }
60906
60999
  const session = binding.session;
61000
+ const projections = session.projections;
61001
+ const inbox = projections?.faceOf?.("inbox") ?? EMPTY_INBOX_FACE;
60907
61002
  try {
60908
61003
  const opened = session.open?.();
60909
61004
  if (opened !== void 0 && typeof opened.catch === "function") {
@@ -60930,6 +61025,7 @@ function openSessionView(sessions, uiConversation, id3, retainSource = DEFAULT_R
60930
61025
  return {
60931
61026
  target,
60932
61027
  session,
61028
+ inbox,
60933
61029
  dispose: releaseRef,
60934
61030
  loadOlder() {
60935
61031
  try {
@@ -62162,6 +62258,14 @@ var docData = {
62162
62258
  "zh": "\u5F52\u6863\u6001\u4E0D\u9700\u8981\u8C03\u7528\u65B9\u4F20\uFF1A\u6838\u5FC3\u8BA2\u9605\u5B98\u65B9 `workspaces.list` \u5FEB\u7167\u7684 `archivedSessionIds`\uFF08\u5BBF\u4E3B `domain/changed` \u2192 `workspace/follow` \u589E\u91CF\u63A8\u9001\uFF09\uFF0C\u5F39\u7A97\u5F00\u7740\u671F\u95F4\u5F52\u6863\u5FBD\u6807\u4E0E\u300C\u7EE7\u7EED\u5BF9\u8BDD\u300D\u5B9E\u65F6\u8DDF\u968F\uFF1B\u70B9\u51FB\u524D\u8FD8\u4F1A\u7528\u6743\u5A01\u5FEB\u7167\u590D\u6838\uFF0C\u4E0D\u4F1A\u76F4\u5F00\u5DF2\u5F52\u6863\u4F1A\u8BDD\u3002\u524D\u63D0\u662F\u63D2\u4EF6 client `apply` \u8C03\u8FC7\u4E00\u6B21 `connectHost(ctx)`\u3002\u5F52\u6863\u4F1A\u8BDD\u8D70\u540C\u4E00\u6761\u6570\u636E\u94FE\uFF0C\u540C\u6837\u53EF\u8BFB\u3002",
62163
62259
  "en": 'Archive state needs no prop: core subscribes to `archivedSessionIds` on the official `workspaces.list` snapshot (host `domain/changed` \u2192 `workspace/follow` increments), so the badge and "Continue" follow changes while the dialog stays open; the click re-checks the authoritative snapshot so an archived session is never opened directly. Call `connectHost(ctx)` once in the plugin client `apply`. Archived sessions use the same data chain and read fine.'
62164
62260
  },
62261
+ {
62262
+ "zh": "\u300C\u7EE7\u7EED\u5BF9\u8BDD\u300D\u59CB\u7EC8\u4FDD\u7559\uFF1A\u672A\u5F52\u6863\u662F\u4F1A\u8BDD\u56FE\u6807\u3001\u70B9\u51FB\u76F4\u8DF3\u5B98\u65B9\u4F1A\u8BDD\u533A\uFF1B\u5DF2\u5F52\u6863\u6362\u6210\u5F00\u5206\u652F\u56FE\u6807\u3001\u70B9\u51FB\u5148\u5F39\u786E\u8BA4\u6846\uFF08fork \u51FA\u5B50\u4F1A\u8BDD\u518D\u8DF3\u8F6C\uFF09\u3002\u6309\u94AE\u53EA\u5728\u7F3A `openHostSession` \u65F6\u7F3A\u5E2D\uFF1B\u7F3A `forkSession` \u65F6\u786E\u8BA4\u6846\u5185\u5982\u5B9E\u8BF4\u660E\u80FD\u529B\u672A\u5C31\u4F4D\uFF0C\u4E0D\u9759\u9ED8\u9690\u85CF\u5165\u53E3\u3002",
62263
+ "en": '"Continue" is always kept: for an active session it shows the conversation icon and jumps straight to the official session; for an archived one it switches to the branch icon and opens a confirm dialog before forking into a child session. The button disappears only when `openHostSession` is absent; without `forkSession` the dialog states plainly that the capability is unavailable instead of silently hiding the entry.'
62264
+ },
62265
+ {
62266
+ "zh": "\u65B0\u4F1A\u8BDD\u9996\u8F6E\uFF1A\u9996\u4E2A\u6A21\u578B\u4E8B\u4EF6\u843D\u76D8\u524D\uFF0C\u7528\u6237\u63D0\u793A\u8BCD\u53EA\u5728\u5B98\u65B9 `inbox` \u6295\u5F71\u4E0E `session.pendingSubmissions` \u672C\u5730\u56DE\u663E\u91CC\uFF0C`chat.order` \u8FD8\u6CA1\u6709 user \u8282\u70B9\u3002\u6838\u5FC3\u4E24\u8DEF\u5408\u5E76\u6E32\u67D3\uFF08\u6309 rpcId \u53BB\u91CD\uFF09\uFF0C\u6240\u4EE5\u521A\u53D1\u5B8C\u63D0\u793A\u8BCD\u5C31\u6253\u5F00\u9884\u89C8\u4E5F\u80FD\u7ACB\u523B\u770B\u5230\u81EA\u5DF1\u53D1\u7684\u8BDD\uFF1B\u6295\u5F71\u4E0E\u56DE\u663E\u90FD\u7F3A\u5E2D\u65F6\u4E0D\u7F16\u9020\u6C14\u6CE1\u3002",
62267
+ "en": "First turn: before the first model event is durable, the user prompt lives only in the official `inbox` projection and the `session.pendingSubmissions` local echo \u2014 `chat.order` has no user node yet. Core merges both sources (deduped by rpcId), so opening the preview right after sending a prompt still shows what you wrote; nothing is invented when neither source is present."
62268
+ },
62165
62269
  {
62166
62270
  "zh": "\u5FEB\u7167\u53EA\u8BFB\uFF0C\u6846\u5185\u4E0D\u80FD\u6253\u5B57\u7EED\u804A\u3002\u7EED\u804A = `forkSession` \u5F00\u5206\u652F + `openHostSession` \u8DF3\u5B98\u65B9\u4F1A\u8BDD\u533A\uFF1B\u6682\u5B58\u8F93\u5165\u6846\u7684\u786E\u5B9A\u8D70 `onContinue`\uFF08fork + \u53D1\u9996\u8F6E + \u8DF3\u8F6C\uFF09\u3002",
62167
62271
  "en": "The snapshot is read-only, so you cannot type inside the dialog. Continuing means `forkSession` + `openHostSession`; the staging input\u2019s confirm goes through `onContinue` (fork + first turn + navigate)."
@@ -62207,8 +62311,17 @@ var docData = {
62207
62311
  "type": "SnapshotFace<SessionSnapshotFace>",
62208
62312
  "def": "\u2014",
62209
62313
  "desc": {
62210
- "zh": "\u4F1A\u8BDD\u81EA\u8EAB\u5FEB\u7167\uFF08\u52A0\u8F7D\u6001 / \u662F\u5426\u7FFB\u5C3D\uFF09",
62211
- "en": "Snapshot of the session itself (loading state, paged-out)"
62314
+ "zh": "\u4F1A\u8BDD\u81EA\u8EAB\u5FEB\u7167\uFF08\u52A0\u8F7D\u6001 / \u662F\u5426\u7FFB\u5C3D / \u672C\u5730\u63D0\u4EA4\u56DE\u663E\uFF09",
62315
+ "en": "Snapshot of the session itself (loading state, paged-out, local submission echoes)"
62316
+ }
62317
+ },
62318
+ {
62319
+ "name": "inbox",
62320
+ "type": "SnapshotFace<unknown>",
62321
+ "def": "\u2014",
62322
+ "desc": {
62323
+ "zh": '\u5B98\u65B9 `inbox` \u6295\u5F71\u8BA2\u9605\u9762\uFF08faceOf("inbox")\uFF09\uFF1B\u9996\u8F6E\u7B49\u5F85\u671F\u7528\u6237\u6D88\u606F\u7684 host \u4FA7\u771F\u6E90\uFF0C\u7531 openSessionView \u63A5\u597D\uFF0C\u8C03\u7528\u65B9\u96F6\u63A5\u7EBF',
62324
+ "en": 'Official `inbox` projection surface (faceOf("inbox")); the host-side source of first-turn user messages, wired by openSessionView \u2014 no caller setup'
62212
62325
  }
62213
62326
  },
62214
62327
  {
@@ -62279,8 +62392,8 @@ var docData = {
62279
62392
  "type": "(sessionId, atSeq?) => Promise<string>",
62280
62393
  "def": "\u2014",
62281
62394
  "desc": {
62282
- "zh": "\u5F00\u5206\u652F\u5E76\u8FD4\u56DE\u5B50\u4F1A\u8BDD id\uFF1B\u7F3A openHostSession \u5219\u4E0D\u6E32\u67D3\u300C\u7EE7\u7EED\u5BF9\u8BDD\u300D",
62283
- "en": 'Fork and resolve the child session id; without openHostSession "Continue" does not render'
62395
+ "zh": "\u5F00\u5206\u652F\u5E76\u8FD4\u56DE\u5B50\u4F1A\u8BDD id\uFF1B\u5DF2\u5F52\u6863\u4F1A\u8BDD\u7684\u300C\u7EE7\u7EED\u5BF9\u8BDD\u300D\u59CB\u7EC8\u6E32\u67D3\uFF0C\u7F3A\u5B83\u65F6\u786E\u8BA4\u6846\u5185\u5982\u5B9E\u8BF4\u660E\u80FD\u529B\u672A\u5C31\u4F4D",
62396
+ "en": 'Fork and resolve the child session id; "Continue" stays rendered for archived sessions, and the dialog states plainly when this capability is missing'
62284
62397
  }
62285
62398
  },
62286
62399
  {
@@ -62335,12 +62448,12 @@ var docData = {
62335
62448
  {
62336
62449
  "id": "session-usage",
62337
62450
  "lang": "tsx",
62338
- "src": "import { openSessionView, openSessionReview, SessionViewModal } from 'dsh-plugin-core/session'\n\n// \u5BBF\u4E3B\u670D\u52A1\u7531\u8C03\u7528\u65B9\u6CE8\u5165\uFF1Asessions \u2190 dsh-api-session-controller\u3001\n// uiConversation \u2190 dsh-client-ui-conversation\nconst view = openSessionView(sessions, uiConversation, sessionId, 'dsh-task-reminder')\nif (view !== null) {\n h(SessionViewModal, {\n sessionId,\n view,\n heading: '\u955C\u50CF\u5347\u7EA7\u65E5\u62A5', // \u6807\u9898\uFF0C\u7F3A\u7701\u300C\u4F1A\u8BDD\u9884\u89C8\u300D\n onClose: () => { view.dispose(); setOpen(false) }, // \u5173\u95ED\u5FC5\u987B dispose\n // \u7EED\u804A\uFF08\u53EF\u9009\uFF09\uFF1Afork \u5F00\u5206\u652F \u2192 \u8DF3\u5B98\u65B9\u4F1A\u8BDD\u533A\uFF1B\u4E24\u8005\u7F3A\u4E00\u5373\u4E0D\u6E32\u67D3\u8BE5\u5165\u53E3\n forkSession: (id, atSeq) => sessions.fork({ sessionId: id, increaseTitle: true, atSeq }),\n openHostSession: (id) => uiWorkspace.openSession(id),\n // \u6682\u5B58\u8F93\u5165\u6846\uFF08\u53EF\u9009\uFF09\uFF1A\u7531\u8C03\u7528\u65B9 fork + \u53D1\u9996\u8F6E + \u8DF3\u8F6C\n onContinue: async (message) => {\n const child = await forkSession(sessionId)\n await hostContinue(child, message)\n openHostSession(child)\n },\n // \u6587\u4EF6\u6253\u5F00\u51FA\u53E3\uFF1A\u7ED9\u4E00\u4E2A\u843D\u70B9\u5373\u53EF\uFF08\u5143\u7D20\u6216\u9009\u62E9\u5668\uFF09\uFF0C\u6838\u5FC3\u81EA\u5E26\u53F3\u4FA7\u5206\u680F\n onOpenFile: (path, sid, opts) => openFilePreview({ mount: '#page-row', path, sessionId: sid, line: opts?.line }),\n // \u53D8\u66F4\u6587\u4EF6\u5BA1\u9605\uFF1A\u4E00\u884C\u6253\u5F00\u90A3\u6B21\u6539\u52A8\u7684 diff\uFF08\u9762\u677F / \u5173\u95ED\u94AE\u5168\u5F52\u6838\u5FC3\uFF09\n onOpenReview: (locator) => openSessionReview({ mount: '#page-row', locator }),\n // \u5F52\u6863\u6001\u4E0D\u7528\u4F20\uFF1A\u6838\u5FC3\u8BA2\u9605\u5B98\u65B9 workspaces \u5FEB\u7167\uFF08apply \u91CC connectHost \u63A5\u7EBF\u4E00\u6B21\u5373\u53EF\uFF09\n t, // \u53EF\u9009\uFF0C\u8986\u76D6\u6587\u6848\n })\n}"
62451
+ "src": "import { openSessionView, openSessionReview, SessionViewModal } from 'dsh-plugin-core/session'\n\n// \u5BBF\u4E3B\u670D\u52A1\u7531\u8C03\u7528\u65B9\u6CE8\u5165\uFF1Asessions \u2190 dsh-api-session-controller\u3001\n// uiConversation \u2190 dsh-client-ui-conversation\nconst view = openSessionView(sessions, uiConversation, sessionId, 'dsh-task-reminder')\nif (view !== null) {\n h(SessionViewModal, {\n sessionId,\n view,\n heading: '\u955C\u50CF\u5347\u7EA7\u65E5\u62A5', // \u6807\u9898\uFF0C\u7F3A\u7701\u300C\u4F1A\u8BDD\u9884\u89C8\u300D\n onClose: () => { view.dispose(); setOpen(false) }, // \u5173\u95ED\u5FC5\u987B dispose\n // \u7EED\u804A\uFF08\u53EF\u9009\uFF09\uFF1Afork \u5F00\u5206\u652F \u2192 \u8DF3\u5B98\u65B9\u4F1A\u8BDD\u533A\uFF1B\u7F3A openHostSession \u624D\u4E0D\u6E32\u67D3\u8BE5\u5165\u53E3\n forkSession: (id, atSeq) => sessions.fork({ sessionId: id, increaseTitle: true, atSeq }),\n openHostSession: (id) => uiWorkspace.openSession(id),\n // \u6682\u5B58\u8F93\u5165\u6846\uFF08\u53EF\u9009\uFF09\uFF1A\u7531\u8C03\u7528\u65B9 fork + \u53D1\u9996\u8F6E + \u8DF3\u8F6C\n onContinue: async (message) => {\n const child = await forkSession(sessionId)\n await hostContinue(child, message)\n openHostSession(child)\n },\n // \u6587\u4EF6\u6253\u5F00\u51FA\u53E3\uFF1A\u7ED9\u4E00\u4E2A\u843D\u70B9\u5373\u53EF\uFF08\u5143\u7D20\u6216\u9009\u62E9\u5668\uFF09\uFF0C\u6838\u5FC3\u81EA\u5E26\u53F3\u4FA7\u5206\u680F\n onOpenFile: (path, sid, opts) => openFilePreview({ mount: '#page-row', path, sessionId: sid, line: opts?.line }),\n // \u53D8\u66F4\u6587\u4EF6\u5BA1\u9605\uFF1A\u4E00\u884C\u6253\u5F00\u90A3\u6B21\u6539\u52A8\u7684 diff\uFF08\u9762\u677F / \u5173\u95ED\u94AE\u5168\u5F52\u6838\u5FC3\uFF09\n onOpenReview: (locator) => openSessionReview({ mount: '#page-row', locator }),\n // \u5F52\u6863\u6001\u4E0D\u7528\u4F20\uFF1A\u6838\u5FC3\u8BA2\u9605\u5B98\u65B9 workspaces \u5FEB\u7167\uFF08apply \u91CC connectHost \u63A5\u7EBF\u4E00\u6B21\u5373\u53EF\uFF09\n t, // \u53EF\u9009\uFF0C\u8986\u76D6\u6587\u6848\n })\n}"
62339
62452
  },
62340
62453
  {
62341
62454
  "id": "session-data-chain",
62342
62455
  "lang": "ts",
62343
- "src": "// \u6570\u636E\u94FE\uFF08\u8D8A\u5F80\u4E0A\u8D8A\u65E9\uFF09\uFF1A\n// sessions.retain(id, { source }) \u7269\u5316 scope\n// \u2192 sessions.binding(id) \u53D6\u7ED1\u5B9A\n// \u2192 session.open() \u5E42\u7B49\u62C9\u5386\u53F2\u5C3E\u9875\n// \u2192 uiConversation.binding(binding).target('chat')\n// \u62FF ChatSnapshot\uFF1Aorder + nodes\uFF08keyed \u6D41\uFF09\n// \u7528\u5B8C\u5FC5\u987B view.dispose()\uFF0C\u5426\u5219\u4F1A\u8BDD scope \u4E0D\u56DE\u6536\u3002"
62456
+ "src": "// \u6570\u636E\u94FE\uFF08\u8D8A\u5F80\u4E0A\u8D8A\u65E9\uFF09\uFF1A\n// sessions.retain(id, { source }) \u7269\u5316 scope\n// \u2192 sessions.binding(id) \u53D6\u7ED1\u5B9A\n// \u2192 session.open() \u5E42\u7B49\u62C9\u5386\u53F2\u5C3E\u9875\n// \u2192 uiConversation.binding(binding).target('chat')\n// \u62FF ChatSnapshot\uFF1Aorder + nodes\uFF08keyed \u6D41\uFF09\n// \u2192 session.projections.faceOf('inbox')\n// \u9996\u8F6E\u7B49\u5F85\u671F\u7528\u6237\u6D88\u606F\uFF08host \u6295\u5F71\uFF0C\u51B7\u8BFB\u4E5F\u62FF\u5F97\u5230\uFF09\n// \u7528\u5B8C\u5FC5\u987B view.dispose()\uFF0C\u5426\u5219\u4F1A\u8BDD scope \u4E0D\u56DE\u6536\u3002"
62344
62457
  }
62345
62458
  ]
62346
62459
  },
@@ -67644,12 +67757,12 @@ notify('\u78C1\u76D8\u7A7A\u95F4\u4E0D\u8DB3', { variant: 'warning', description
67644
67757
  notify('\u5DF2\u5220\u9664\u8BE5\u6587\u4EF6', {
67645
67758
  variant: 'success',
67646
67759
  description: '\u53EF\u5728 10 \u79D2\u5185\u64A4\u9500',
67647
- actions: [{ text: '\u64A4\u9500', variant: 'outline', onClick: () => {} }],
67760
+ actions: [{ text: '\u64A4\u9500', variant: 'info', onClick: () => {} }],
67648
67761
  })
67649
67762
  notify('\u786E\u8BA4\u63D0\u4EA4\u5417\uFF1F', {
67650
67763
  description: '\u63D0\u4EA4\u540E\u5C06\u901A\u77E5\u76F8\u5173\u6210\u5458',
67651
67764
  actions: [
67652
- { text: '\u53D6\u6D88', variant: 'outline', onClick: () => {} },
67765
+ { text: '\u53D6\u6D88', variant: 'info', onClick: () => {} },
67653
67766
  { text: '\u63D0\u4EA4', variant: 'primary', onClick: () => {} },
67654
67767
  ],
67655
67768
  })`;
@@ -68132,7 +68245,7 @@ function FeedbackPage() {
68132
68245
  onClick: () => notify("\u5DF2\u5220\u9664\u8BE5\u6587\u4EF6", {
68133
68246
  variant: "success",
68134
68247
  description: "\u53EF\u5728 10 \u79D2\u5185\u64A4\u9500",
68135
- actions: [{ text: "\u64A4\u9500", variant: "outline", onClick: () => notify("\u5DF2\u64A4\u9500") }]
68248
+ actions: [{ text: "\u64A4\u9500", variant: "info", onClick: () => notify("\u5DF2\u64A4\u9500") }]
68136
68249
  })
68137
68250
  },
68138
68251
  "\u5355\u6309\u94AE+\u63CF\u8FF0"
@@ -68143,7 +68256,7 @@ function FeedbackPage() {
68143
68256
  onClick: () => notify("\u786E\u8BA4\u63D0\u4EA4\u5417\uFF1F", {
68144
68257
  description: "\u63D0\u4EA4\u540E\u5C06\u901A\u77E5\u76F8\u5173\u6210\u5458",
68145
68258
  actions: [
68146
- { text: "\u53D6\u6D88", variant: "outline", onClick: () => notify("\u5DF2\u53D6\u6D88") },
68259
+ { text: "\u53D6\u6D88", variant: "info", onClick: () => notify("\u5DF2\u53D6\u6D88") },
68147
68260
  { text: "\u63D0\u4EA4", variant: "primary", onClick: () => notify("\u5DF2\u63D0\u4EA4", { variant: "success" }) }
68148
68261
  ]
68149
68262
  })
@@ -69416,9 +69529,9 @@ function ReferencePage() {
69416
69529
  "tbody",
69417
69530
  null,
69418
69531
  [
69419
- [t3("buildCore"), `v${"0.30.0"}`],
69420
- [t3("buildDemo"), `v${"0.30.0"}`],
69421
- [t3("buildStamp"), "261104-115235-188"]
69532
+ [t3("buildCore"), `v${"0.30.2"}`],
69533
+ [t3("buildDemo"), `v${"0.30.2"}`],
69534
+ [t3("buildStamp"), "261104-152208-724"]
69422
69535
  ].map(
69423
69536
  ([label, value]) => (0, import_react93.createElement)(
69424
69537
  "tr",
@@ -69730,9 +69843,9 @@ function DemoPage() {
69730
69843
  lineHeight: "14px"
69731
69844
  }
69732
69845
  },
69733
- (0, import_react95.createElement)("span", null, `core v${"0.30.0"}`),
69734
- (0, import_react95.createElement)("span", null, `demo v${"0.30.0"}`),
69735
- (0, import_react95.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261104-115235-188")
69846
+ (0, import_react95.createElement)("span", null, `core v${"0.30.2"}`),
69847
+ (0, import_react95.createElement)("span", null, `demo v${"0.30.2"}`),
69848
+ (0, import_react95.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261104-152208-724")
69736
69849
  )
69737
69850
  )
69738
69851
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-core-demo",
3
- "version": "0.30.0",
3
+ "version": "0.30.2",
4
4
  "description": "The shared UI foundation for DSH plugins, with a live component preview: design tokens, common controls, workspace browsing and notifications maintained in one place — install it to preview every component in a real host.",
5
5
  "icon": "./assets/icon-components.svg",
6
6
  "keywords": [