dsh-spec-collab 0.2.2 → 0.3.1

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 (57) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +84 -18
  3. package/docs/assets/demo-01-workspace.png +0 -0
  4. package/docs/assets/demo-02-ai-review.png +0 -0
  5. package/docs/assets/demo-03-patches.png +0 -0
  6. package/docs/assets/demo-04-decisions.png +0 -0
  7. package/docs/assets/demo-05-ready.png +0 -0
  8. package/docs/experience-review-checklist-2026-08-24.md +72 -45
  9. package/docs/insight-import-template.csv +3 -0
  10. package/docs/insight-import-template.md +19 -0
  11. package/docs/migration-v3.md +23 -0
  12. package/docs/usage-walkthrough.md +25 -43
  13. package/lib/client.js +10854 -1168
  14. package/lib/index.js +1313 -98
  15. package/lib/types/client/AccessibleDialog.d.ts +9 -0
  16. package/lib/types/client/AccessibleDialog.d.ts.map +1 -0
  17. package/lib/types/client/SpecWorkbench.d.ts +42 -2
  18. package/lib/types/client/SpecWorkbench.d.ts.map +1 -1
  19. package/lib/types/client/api.d.ts +26 -3
  20. package/lib/types/client/api.d.ts.map +1 -1
  21. package/lib/types/client/drafts.d.ts +8 -0
  22. package/lib/types/client/drafts.d.ts.map +1 -0
  23. package/lib/types/client/mount.d.ts.map +1 -1
  24. package/lib/types/client/review-anchors.d.ts.map +1 -1
  25. package/lib/types/client/workflow.d.ts.map +1 -1
  26. package/lib/types/engine.d.ts +37 -3
  27. package/lib/types/engine.d.ts.map +1 -1
  28. package/lib/types/git-store.d.ts +6 -0
  29. package/lib/types/git-store.d.ts.map +1 -1
  30. package/lib/types/protocol.d.ts +245 -10
  31. package/lib/types/protocol.d.ts.map +1 -1
  32. package/lib/types/ready-admission.d.ts +14 -0
  33. package/lib/types/ready-admission.d.ts.map +1 -0
  34. package/lib/types/review-runtime.d.ts +6 -0
  35. package/lib/types/review-runtime.d.ts.map +1 -1
  36. package/lib/types/routes.d.ts.map +1 -1
  37. package/lib/types/structured-diff.d.ts +3 -0
  38. package/lib/types/structured-diff.d.ts.map +1 -0
  39. package/package.json +14 -4
  40. package/src/client/AccessibleDialog.tsx +42 -0
  41. package/src/client/SpecWorkbench.tsx +776 -87
  42. package/src/client/api.ts +8 -3
  43. package/src/client/drafts.ts +51 -0
  44. package/src/client/mount.tsx +11 -6
  45. package/src/client/review-anchors.ts +1 -0
  46. package/src/client/workbench.module.css +223 -79
  47. package/src/client/workflow.ts +8 -9
  48. package/src/engine.ts +448 -46
  49. package/src/git-store.ts +87 -18
  50. package/src/index.ts +1 -1
  51. package/src/protocol.ts +64 -13
  52. package/src/ready-admission.ts +29 -0
  53. package/src/review-runtime.ts +39 -11
  54. package/src/routes.ts +33 -4
  55. package/src/structured-diff.ts +75 -0
  56. package/src/tools.ts +1 -1
  57. package/docs/assets/spec-collab-walkthrough.mp4 +0 -0
package/src/tools.ts CHANGED
@@ -26,7 +26,7 @@ export function specReadTool(engine: CollaborationEngine) {
26
26
  const rows = [`# ${view.title}`, `stage: ${view.stage}`, `commit: ${view.currentCommit}`]
27
27
  if (include.has('spec')) rows.push('', '## Spec', view.version.markdown)
28
28
  if (include.has('review-items')) rows.push('', '## Review Items', ...view.reviewItems.map(item => `- ${item.id} [${item.severity}/${item.status}/${item.epistemicStatus}] ${item.statement}\n Question: ${item.question}\n Spec anchors: ${(item.sourceAnchors ?? []).map(anchor => `${anchor.heading ? `${anchor.heading}: ` : ''}${anchor.quote}`).join(' / ') || 'none'}\n Recommended options: ${(item.recommendedOptions ?? []).join(' / ') || 'none'}\n Evidence: ${item.evidence.map(evidence => `${evidence.source}${evidence.version ? `@${evidence.version}` : ''}`).join(', ') || 'none'}`))
29
- if (include.has('comments')) rows.push('', '## Comments', ...view.comments.map(item => `- ${item.id} [${item.status}] “${item.anchor.quote}” ${item.author.nickname}: ${item.body}\n Replies: ${item.replies.map(reply => `${reply.author.nickname}: ${reply.body}`).join(' / ') || 'none'}`))
29
+ if (include.has('comments')) rows.push('', '## Comments', ...view.comments.map(item => `- ${item.id} [${item.status}] “${item.anchor?.quote ?? '整篇需求'}” ${item.author.nickname}: ${item.body}\n Replies: ${item.replies.map(reply => `${reply.author.nickname}: ${reply.body}`).join(' / ') || 'none'}`))
30
30
  if (include.has('decisions')) rows.push('', '## Decisions', ...view.decisions.map(item => `- ${item.id} [${item.status}] ${item.question}: ${item.decision}`))
31
31
  if (include.has('confirmations')) rows.push('', '## Confirmations', ...view.confirmations.map(item => `- ${item.role}/${item.scope}/${item.scopeId ?? 'document'} [${item.status}] ${item.participant.nickname} @ ${item.commit}`))
32
32
  if (include.has('sources')) rows.push('', '## Sources', ...view.sources.map(item => `- ${item.id} [${item.accessStatus}] ${item.label}${item.version ? ` @ ${item.version}` : ''}`))