@markus-global/cli 0.11.2-rc.0 → 0.11.3-rc.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.
Files changed (104) hide show
  1. package/dist/commands/start.js +5 -2
  2. package/dist/commands/start.js.map +1 -1
  3. package/dist/markus.mjs +1260 -1125
  4. package/dist/web-ui/assets/{CommentInput-Cqi5Hldw.js → CommentInput-C-niUbUY.js} +1 -1
  5. package/dist/web-ui/assets/{ContentRenderer-BAB3il9e.js → ContentRenderer-DxsnJJRX.js} +2 -2
  6. package/dist/web-ui/assets/{DeliverableShareModal-DJXkM66x.js → DeliverableShareModal-DV3TiZx0.js} +1 -1
  7. package/dist/web-ui/assets/{Deliverables-zKPxgZAN.js → Deliverables-tlLsJnxZ.js} +1 -1
  8. package/dist/web-ui/assets/{Notifications-HAycgg2x.js → Notifications-4KXYRdkr.js} +1 -1
  9. package/dist/web-ui/assets/{Search-SZuDcxy0.js → Search-CPFwZv1U.js} +1 -1
  10. package/dist/web-ui/assets/{Settings-CZgNsYSC.js → Settings-DIa-_qre.js} +6 -6
  11. package/dist/web-ui/assets/{Store-BS7VNrsr.js → Store-JWjwXfTU.js} +1 -1
  12. package/dist/web-ui/assets/Team-COBxn96h.js +84 -0
  13. package/dist/web-ui/assets/{Work-BN-LsW3k.js → Work-BScJUqWL.js} +1 -1
  14. package/dist/web-ui/assets/{arc-CsnWE2QW.js → arc-DPZmpo1U.js} +1 -1
  15. package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-CLek8I2z.js → architectureDiagram-3BPJPVTR-DlOs02JO.js} +1 -1
  16. package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-jSgWEHN7.js → blockDiagram-GPEHLZMM-C7qsXNUe.js} +1 -1
  17. package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-BaC188UT.js → c4Diagram-AAUBKEIU-Drwp-rtM.js} +1 -1
  18. package/dist/web-ui/assets/channel-DCChB-1T.js +1 -0
  19. package/dist/web-ui/assets/{chunk-2J33WTMH-CdtP4-T4.js → chunk-2J33WTMH-VgR09Mqk.js} +1 -1
  20. package/dist/web-ui/assets/{chunk-4BX2VUAB-BSgBKyC9.js → chunk-4BX2VUAB-CuwDpBRL.js} +1 -1
  21. package/dist/web-ui/assets/{chunk-55IACEB6-XB_ZMqfw.js → chunk-55IACEB6-nC7YWJ_i.js} +1 -1
  22. package/dist/web-ui/assets/{chunk-727SXJPM-YFPBFW4M.js → chunk-727SXJPM-Dw6mBsRE.js} +1 -1
  23. package/dist/web-ui/assets/{chunk-AQP2D5EJ-CDbFN1Un.js → chunk-AQP2D5EJ-CPhNJbHl.js} +1 -1
  24. package/dist/web-ui/assets/{chunk-FMBD7UC4-BGKt8xP8.js → chunk-FMBD7UC4-AyhQakG8.js} +1 -1
  25. package/dist/web-ui/assets/{chunk-ND2GUHAM-DKicpX2b.js → chunk-ND2GUHAM-DgYemv8I.js} +1 -1
  26. package/dist/web-ui/assets/{chunk-QZHKN3VN-BD4tv8RZ.js → chunk-QZHKN3VN-CLdqxrFB.js} +1 -1
  27. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-CrNiYfSI.js +1 -0
  28. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-CrNiYfSI.js +1 -0
  29. package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-BjOoIarG.js → cose-bilkent-S5V4N54A-DrOgwDIH.js} +1 -1
  30. package/dist/web-ui/assets/{dagre-BM42HDAG-BWal5GOH.js → dagre-BM42HDAG-DhoJiA83.js} +1 -1
  31. package/dist/web-ui/assets/{diagram-2AECGRRQ-CJj-CzRg.js → diagram-2AECGRRQ-BDILSgqK.js} +1 -1
  32. package/dist/web-ui/assets/{diagram-5GNKFQAL-4IMjuEPm.js → diagram-5GNKFQAL-CeXywd1i.js} +1 -1
  33. package/dist/web-ui/assets/{diagram-KO2AKTUF-DQiRAfss.js → diagram-KO2AKTUF-Bi4RlMT0.js} +1 -1
  34. package/dist/web-ui/assets/{diagram-LMA3HP47-BMPvbEbY.js → diagram-LMA3HP47-Cw1yxk8b.js} +1 -1
  35. package/dist/web-ui/assets/{diagram-OG6HWLK6-D5_vmdXl.js → diagram-OG6HWLK6-Bl857da2.js} +1 -1
  36. package/dist/web-ui/assets/{docx-preview-Cdouj_6e.js → docx-preview-CjoUhrMq.js} +1 -1
  37. package/dist/web-ui/assets/{erDiagram-TEJ5UH35-DOnDuvXd.js → erDiagram-TEJ5UH35-DEiaMhuV.js} +1 -1
  38. package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-DL6G76eC.js → flowDiagram-I6XJVG4X-BgKZhO0h.js} +1 -1
  39. package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-CwHnuRR8.js → ganttDiagram-6RSMTGT7-Dkx-EaS8.js} +1 -1
  40. package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-BFUnsmW_.js → gitGraphDiagram-PVQCEYII-DXaQwA0y.js} +1 -1
  41. package/dist/web-ui/assets/{index-BSktaJwx.js → index-C_QhfMcC.js} +74 -74
  42. package/dist/web-ui/assets/index-DEN_qReg.css +1 -0
  43. package/dist/web-ui/assets/{infoDiagram-5YYISTIA-DhU1bQNw.js → infoDiagram-5YYISTIA-Dpx9IOkx.js} +1 -1
  44. package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-o6ujfUJF.js → ishikawaDiagram-YF4QCWOH-BWqWgitQ.js} +1 -1
  45. package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-Dx_SZ8zv.js → journeyDiagram-JHISSGLW-BBwIZ4k9.js} +1 -1
  46. package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-D4BWXcIn.js → kanban-definition-UN3LZRKU-C_MRWV8R.js} +1 -1
  47. package/dist/web-ui/assets/{mermaid.core-BHDulYyB.js → mermaid.core-BMAh3nnq.js} +5 -5
  48. package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-BVy6py_h.js → mindmap-definition-RKZ34NQL-B6vJQcat.js} +1 -1
  49. package/dist/web-ui/assets/{pieDiagram-4H26LBE5-CUr5__J1.js → pieDiagram-4H26LBE5-BxdEttqt.js} +1 -1
  50. package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-C5Owt_r4.js → quadrantDiagram-W4KKPZXB-gsNs2VfP.js} +1 -1
  51. package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-Bb933lBb.js → requirementDiagram-4Y6WPE33-BSC9KvC2.js} +1 -1
  52. package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-CJq-boMJ.js → sankeyDiagram-5OEKKPKP-DktAZfe_.js} +1 -1
  53. package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-BP8L47v3.js → sequenceDiagram-3UESZ5HK-BIPt8kGU.js} +1 -1
  54. package/dist/web-ui/assets/{stateDiagram-AJRCARHV-Byk9-Yrm.js → stateDiagram-AJRCARHV-DiXmJWB0.js} +1 -1
  55. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-COOgTXIX.js +1 -0
  56. package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-2z8RR-l_.js → timeline-definition-PNZ67QCA-LRi7H35g.js} +1 -1
  57. package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-CSwDDhHv.js → vennDiagram-CIIHVFJN-DWQ1I022.js} +1 -1
  58. package/dist/web-ui/assets/{wardley-L42UT6IY-DW30MdHd.js → wardley-L42UT6IY-BUb6dYqN.js} +1 -1
  59. package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-DUb2r21l.js → wardleyDiagram-YWT4CUSO-BYE1B3xT.js} +1 -1
  60. package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-4DTcVUL8.js → xychartDiagram-2RQKCTM6-D-pS2-Sa.js} +1 -1
  61. package/dist/web-ui/index.html +2 -2
  62. package/docs/README.md +93 -0
  63. package/docs/api/api.md +353 -0
  64. package/docs/architecture/agent-runtime.md +341 -0
  65. package/docs/architecture/architecture-fragility.md +184 -0
  66. package/docs/architecture/architecture.md +938 -0
  67. package/docs/architecture/cognitive-architecture.md +322 -0
  68. package/docs/architecture/concurrent-processing.md +550 -0
  69. package/docs/architecture/frontend/team-chat.md +312 -0
  70. package/docs/architecture/learning-loop.md +340 -0
  71. package/docs/architecture/llm-provider-timeouts.md +60 -0
  72. package/docs/architecture/mailbox-system.md +1635 -0
  73. package/docs/architecture/memory-system.md +533 -0
  74. package/docs/architecture/prompt-engineering.md +1377 -0
  75. package/docs/architecture/state-machines.md +665 -0
  76. package/docs/architecture/state-ownership.md +83 -0
  77. package/docs/architecture/streaming-and-reattach.md +193 -0
  78. package/docs/architecture/tool-system.md +266 -0
  79. package/docs/design/deliverable-sharing.md +238 -0
  80. package/docs/guides/coding-tools.md +765 -0
  81. package/docs/guides/community.md +104 -0
  82. package/docs/guides/development.md +179 -0
  83. package/docs/guides/guide.md +362 -0
  84. package/docs/guides/release-and-distribution.md +165 -0
  85. package/docs/guides/remote-access.md +286 -0
  86. package/docs/guides/skill-ecosystem.md +129 -0
  87. package/docs/records/agent-platform-friction-2026-10.md +98 -0
  88. package/docs/records/animation-budget-focus-vs-visibility-2026-10-08.md +110 -0
  89. package/docs/records/audit-fixes-2026-09.md +173 -0
  90. package/docs/records/branch-consolidation.md +597 -0
  91. package/docs/records/file-edit-literal-replacement-fix.md +132 -0
  92. package/docs/records/message-stop-cancel-fix-plan.md +209 -0
  93. package/docs/records/platform-hardening-2026-10.md +1365 -0
  94. package/docs/records/session-identity-plan.md +130 -0
  95. package/docs/records/settings-model-routing-first-visit-fix.md +101 -0
  96. package/docs/records/team-chat-stream-transport-vs-turn-2026-10-08.md +152 -0
  97. package/package.json +2 -1
  98. package/templates/roles/HANDBOOK.md +12 -7
  99. package/dist/web-ui/assets/Team-B6vw2Oj5.js +0 -84
  100. package/dist/web-ui/assets/channel-CqbBz9iL.js +0 -1
  101. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-DDQJP38f.js +0 -1
  102. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-DDQJP38f.js +0 -1
  103. package/dist/web-ui/assets/index-3PQIqBtv.css +0 -1
  104. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-CWa-Q2Gf.js +0 -1
@@ -0,0 +1,238 @@
1
+ # Deliverable Sharing to Hub — Design Proposal
2
+
3
+ > Author: CTO | Date: 2026-08-12 | **Status: partially implemented** — the Markus client side
4
+ > shipped; the Hub (cloud) side is still pending. See the As-built note below.
5
+ > Scope: joint work across both ends — the Markus client (desktop) + Markus Hub (cloud)
6
+
7
+ > **As built:** the client side shipped. `DeliverableShareService` (`packages/core/src/deliverable-share.ts`) plus the
8
+ > web-ui wrapper/dialog (`packages/web-ui/src/lib/deliverableShare.ts`, `packages/web-ui/src/components/DeliverableShareModal.tsx`)
9
+ > write the §4.1 fields onto `DeliverableRow` (`hubShareId`/`shareStatus`/`shareUrl`/`shareVisibility`, plus a `shareReason`
10
+ > field added for rejection reasons) and call `/api/hub/deliverables/publish|status|revoke` (client also adds
11
+ > `GET /api/hub/deliverables/mine` via `listMine()`) through the client's **generic** `/api/hub/*` proxy in
12
+ > `packages/org-manager/src/api-server.ts`, not a deliverables-specific route. The Hub-side items (§4.2 `DeliverableShare`
13
+ > table, R2 object storage, `/deliverable/{slug}` page, sitemap/search, review queue) live in the separate markus.global
14
+ > service and are not verifiable from this repo.
15
+
16
+ ---
17
+
18
+ ## 1. Background and Goals
19
+
20
+ ### 1.1 Current state
21
+ - A deliverable is the core carrier for the assets an Agent produces — research reports, documents, code, and so on — and currently **exists only on the user's local machine**: the `DeliverableRow` lives in the local SQLite database (`packages/storage`), the file content lives on the local disk, and it is previewed through the built-in browser in the Team Chat right-hand panel.
22
+ - The local `DeliverableRow` has a limited set of fields (`id/type/title/summary/reference/format/tags/status/taskId/agentId/projectId/…`) and no sharing-related fields.
23
+ - Using `/api/hub/publish` + a Hub token, the client can already publish **assets** such as Agent/Skill/Team to the Hub (`POST {hubUrl}/api/items`), and the Hub already has an asset publishing and review mechanism.
24
+ - Deliverables **currently cannot be shared outside the repository / with other users**.
25
+
26
+ ### 1.2 Goals
27
+ Let deliverables be shared to the Hub with one click and generate a shareable link, achieving: others can view them through the link, they participate in SEO indexing, they can be searched by Tag/Summary, they are controlled by visibility, and wide public exposure requires review. The Hub displays a deliverable's provenance (user, time, producing Agent) and can trace back to a Hub asset.
28
+
29
+ ### 1.3 Core scenarios
30
+ - The user has an Agent produce an industry research report / a valuable asset → one-click public or link sharing.
31
+ - Public visibility: visible to everyone, participates in SEO.
32
+ - Link visibility: only people who hold the link can see it.
33
+ - Wide visibility (public / featured recommendation) goes through Hub review.
34
+
35
+ ---
36
+
37
+ ## 2. Current-state Analysis and Design Boundaries
38
+
39
+ | Layer | Current state | To be added this time |
40
+ |----|------|-----------|
41
+ | Client storage | local SQLite `DeliverableRow` | Reserved fields for share status/visibility/share URL |
42
+ | Client files | local disk reference | Upload to Hub object storage |
43
+ | Client UI | right-panel preview | Share button + confirmation dialog |
44
+ | Hub proxy | `/api/hub/publish` (existing) | New `/api/hub/deliverables/*` sharing-related proxy endpoints |
45
+ | Hub server | asset items + review | New deliverable type / standalone page / object storage / SEO / search |
46
+
47
+ **Design boundary**: The Markus Hub server-side asset storage and rendering page are a separate service (markus.global). This proposal defines the **two-sided contract** (API + data model); client changes are implemented in this repository, and the Hub side implements to the contract.
48
+
49
+ ---
50
+
51
+ ## 3. Overall Architecture
52
+
53
+ ```
54
+ [Markus client]
55
+ Deliverable (DeliverableRow + local file)
56
+ │ user clicks "Share to Hub"
57
+ ▼
58
+ Share service (new) ── encapsulates: validation / field completion / object upload ──┐
59
+ │ POST /api/hub/deliverables/publish │ (client goes through the local hub proxy)
60
+ ▼ ▼
61
+ [Hub server] ┌→ review queue (wide visibility) → publish on approval
62
+ /api/deliverables/publish
63
+ ├─ metadata written to DB (DeliverableShare table)
64
+ ├─ file written to object storage (R2/S3)
65
+ └─ generate share record + URL
66
+ │
67
+ ▼
68
+ [Hub frontend]
69
+ Deliverable public page /o/{slug} (or /deliverable/{id})
70
+ ├─ display: owning user / time / producing Agent / preview / download
71
+ ├─ provenance: if the Agent is a Hub asset → jump to the Agent/Team page; local Agent → show name only
72
+ ├─ participates in /sitemap.xml
73
+ └─ supports /api/search (by Tag / Summary / full text)
74
+ ```
75
+
76
+ **Key new concept (introducing a sharing layer)**: one deliverable can have multiple "shares" locally; each share = an independent `DeliverableShare` record (with visibility, status, review, URL), associated with the local `DeliverableRow` through `localDeliverableId`.
77
+
78
+ ---
79
+
80
+ ## 4. Data Model Design
81
+
82
+ ### 4.1 Client: DeliverableRow extension (local SQLite)
83
+ New fields (nullable, backward compatible):
84
+
85
+ | Field | Type | Description |
86
+ |------|------|------|
87
+ | `hubShareId` | string\|null | Record id of the most recent share on the Hub |
88
+ | `shareStatus` | string\|null | `none`/`pending_review`/`published`/`rejected`/`revoked` |
89
+ | `shareUrl` | string\|null | Share link (backfilled after publishing) |
90
+ | `shareVisibility` | string\|null | `public`/`link` (no private; `none` = not shared) |
91
+
92
+ ### 4.2 Hub side: DeliverableShare table (new)
93
+ ```
94
+ id string PK Share record (dlv_share_…)
95
+ slug string UNIQUE Public-page short link (readable slug)
96
+ ownerUserId string Hub user id (who shared it)
97
+ ownerName string Display name
98
+ localDeliverableId string Source (client magic string, used for dedup within the same DB)
99
+ title string
100
+ summary string Searchable
101
+ content text Preview content (text, etc.), or an object storage reference
102
+ fileRef string R2/S3 object key
103
+ format string markdown/html/text/json/…
104
+ tags string[] Searchable
105
+ visibility enum public | link ← only two shareable visibilities (no private)
106
+ status enum pending_review | published | rejected | revoked
107
+ producerAgentId string|null Agent id that produced this deliverable
108
+ producerAgentName string Display name of the producing Agent
109
+ producerAgentSource enum|null hub_asset | local ← used for provenance jump / name only
110
+ createdAt datetime
111
+ publishedAt datetime|null
112
+ reviewedBy string|null Reviewer
113
+ reviewAt datetime|null
114
+ ```
115
+
116
+ > **No `private`**: <u>sharing is publishing</u> — this mirrors the Hub asset (Agent/Skill/Team) sharing mental model in one loop: not sharing means no record is produced (it stays local); once a share is initiated, visibility can only be `link` or `public` (both require review).
117
+
118
+ ### 4.3 Hub side: object storage (file upload)
119
+ - Use **Cloudflare R2** as object storage (**consistent with the existing temporary image storage**, reusing the same object storage and credential system).
120
+ - Each deliverable file is stored under the key `deliverables/{ownerUserId}/{shareId}/{filename}`.
121
+ - Metadata and files are separated: the DB stores metadata, object storage stores files; previews fetch from object storage in real time (or generate a CDN-cached URL).
122
+ - For text-type deliverables (markdown/html/text), in addition to the file, **extract clean content** into the DB for search and SEO.
123
+
124
+ ---
125
+
126
+ ## 5. Visibility and Review Model
127
+
128
+ | Visibility | Who can see it | Requires review | Participates in SEO |
129
+ |--------|--------|----------|----------|
130
+ | `link` (visible to whoever holds the link) | Anyone who has the URL (no login required) | **Yes** | **No** (added to the robots blocklist) |
131
+ | `public` (public, wide visibility) | All users + search engines | **Yes** | Yes |
132
+
133
+ > **Sharing is publishing (confirmed)**: not sharing = no record produced (it stays local). Once shared, there are only two visibilities — **`link` / `public`** — and **both go through Hub review**. Default visibility = **`public`**, which the user switches manually in the share dialog. This fully mirrors the Hub asset sharing mental model (Agent/Skill/Team publish → review → public page/link).
134
+
135
+ **Review mechanism (reusing the Hub's existing review flow)**:
136
+ - Reuse the Hub's existing `review/pending/approved/rejected` mechanism for Agent/Skill/Team assets, adding `DeliverableShare` as a reviewable entity type.
137
+ - **Both `link` and `public` trigger review**: after submission `status=pending_review`; if the Hub approves → `published` (`public` is added to the sitemap); if not → `rejected` (with a reason, visible on the client and resubmittable).
138
+ - Abuse prevention: a review queue + a per-user daily submission cap + content size limits.
139
+ - **Ownership (confirmed)**: a share must be bound to a **Hub account** (`ownerUserId` is required); without a Hub account, sharing/publishing is impossible (when not signed in to the Hub, the client disables sharing and prompts the user to sign in).
140
+
141
+ ---
142
+
143
+ ## 6. Frontend Design (client)
144
+
145
+ ### 6.1 Share entry point
146
+ - When the Team Chat right-hand panel **previews a deliverable in the built-in browser**, add a "Share" button (with a share icon) to the toolbar at the top of the preview panel.
147
+ - Available only when the deliverable's `reference` points to an existing local file.
148
+
149
+ ### 6.2 Confirmation dialog (share wizard)
150
+ Clicking "Share" opens a confirmation dialog containing:
151
+ 1. **Hub login check (prerequisite)**: when not signed in to a Hub account, the dialog directly shows "You must sign in to a Markus Hub account before you can share" and guides the user to sign in (corresponding to the "mandatory Hub account" constraint).
152
+ 2. **Visibility selection (single choice, default `public`)**: `Public (visible to everyone + search engines)` / `Visible with link`; the user can switch manually.
153
+ 3. Preview information confirmation: title, summary (editable), Tags (add/remove; recommended to carry over from the deliverable's existing tags).
154
+ 4. **Hint copy**:
155
+ - Selecting "Public" → show "Public deliverables must pass Hub review before they are published; once published, everyone can see them and they participate in search".
156
+ - Selecting "Visible with link" → show "Only people who obtain the link can view it; it does not participate in search engines; it likewise must pass Hub review".
157
+ 5. Primary button "Share to Hub" → calls the share API; on success, the preview panel shows the share link + a "Copy link" button + a status badge (under review / published / rejected).
158
+
159
+ ### 6.3 Status feedback
160
+ - `pending_review`: show "Under review", button disabled.
161
+ - `published`: show a copyable link and allow "Cancel share" (revoke).
162
+ - `rejected`: show the reason + "Resubmit".
163
+
164
+ ---
165
+
166
+ ## 7. Server-side / Hub-side API Design
167
+
168
+ ### 7.1 Client → local proxy → Hub (contract)
169
+ | Method | Path | Description |
170
+ |------|------|------|
171
+ | POST | `/api/hub/deliverables/publish` | Upload and publish (body: `{ visibility, title, summary, tags, filename, content?, fileBase64?, producerAgent:{id,name,source} }`, multipart or JSON+base64) |
172
+ | GET | `/api/hub/deliverables/status?localId=…` | Query share status |
173
+ | POST | `/api/hub/deliverables/revoke` | Cancel a share (public/link → revoked) |
174
+ | GET | `/api/hub/deliverables/{id or slug}` | Read for the public page (for Hub frontend/SSR rendering) |
175
+
176
+ (The client passes through the existing Hub proxy pattern in `packages/org-manager` to avoid CORS.)
177
+
178
+ ### 7.2 Public page (Hub frontend)
179
+ Visiting `/deliverable/{slug}` renders:
180
+ - Header: title, author (`ownerName` + avatar), share time (`publishedAt`).
181
+ - Body: content preview (rich text/text/JSON rendering, depending on format) + a download button (object storage URL).
182
+ - **TJ provenance area (CTI)**:
183
+ - `producerAgentSource === 'hub_asset'` and the Agent/team asset exists on the Hub → render "Produced by Agent [link]" / "Owning team [link]", **clickable to jump** to the Hub's Agent/Team asset page.
184
+ - `producerAgentSource === 'local'` → render only the Agent name as text, with no link.
185
+ - Tag display (clicking searches for the same Tag).
186
+
187
+ ### 7.3 SEO / Sitemap
188
+ - **Only public (`public` and `published`) deliverables enter the search engine index**.
189
+ - When the Hub generates `/sitemap.xml`, it includes every `published && public` `DeliverableShare` (URL is `/deliverable/{slug}`).
190
+ - The public page enables SSR/static pre-rendering + injection of `meta description` (from summary) + `og:title/og:description` (social share cards).
191
+ - `robots.txt`: add `X-Robots-Tag: noindex, nofollow` to the paths where `private`/`link` deliverables live (the link page blocks indexing via a response header).
192
+ - Slugs use keyword-containing readable short links (e.g. `industry-report-ai-2026`) to improve SEO.
193
+
194
+ ### 7.4 Search (Hub)
195
+ - `/api/search` is extended to support the deliverable type; the searched fields are: `title`, `summary`, `tags`, `content` (full text).
196
+ - Index only `published && public` records; `link` records do not enter public search (they are reachable only via URL).
197
+ - Provide filtering by Tag + keyword matching on Summary, for a unified experience with the existing asset search (Agent/Skill/Team).
198
+
199
+ ---
200
+
201
+ ## 8. Security and Privacy
202
+
203
+ - **Credentials**: the share API reuses Hub token authentication; the public page is read-only and requires no login.
204
+ - **Link security**: `link` visibility uses an unguessable slug/short id (e.g. `dlv_` + 24 random characters); it does not rely heavily on "the link is the key" for highly sensitive content, but it satisfies the semantics of the "visible with link" scenario.
205
+ - **Content compliance**: public requires review; provide a "report" entry point; the sharer can `revoke` at any time.
206
+ - **Size limit**: a per-deliverable file cap (50MB suggested); over the limit, prompt for local compression or reject.
207
+ - **Ownership**: only the owner (the Hub user corresponding to the Hub token) can revoke/resubmit.
208
+
209
+ ---
210
+
211
+ ## 9. Phased Implementation
212
+
213
+ **Phase 1 (MVP, usable for self-use/internal beta)**
214
+ - Client: share service + preview-panel "Share" + Hub login check + `link`/`public` visibility selection (default `public`) + review-status display.
215
+ - Hub: `DeliverableShare` table + object storage (R2) + public page (basic rendering) + **`link`/`public` both go through the review queue (reusing Hub review)**.
216
+ - Verify end-to-end "share → pending review → approved → obtain link → someone else opens and views it".
217
+
218
+ **Phase 2 (publishing + SEO + search)**
219
+ - `public` visibility + review queue (reusing Hub review).
220
+ - sitemap / SSR / og-meta / noindex control.
221
+ - Hub search ingests deliverables (Tag/Summary/full text).
222
+
223
+ **Phase 3 (operations hardening)**
224
+ - Complete provenance links (Agent/Team asset jumps), deliverable collection pages (browse by user / by Tag), reporting/statistics (traffic), CDN cache optimization.
225
+
226
+ ---
227
+
228
+ ## 10. Open Questions / Decisions Needed
229
+
230
+ > **Confirmed decisions**: (1) **No `private`** — sharing is publishing (reusing the Agent/Skill/Team asset sharing logic; not sharing = no record produced); (2) default visibility = `public` (changeable manually in the dialog); (3) owner requires a Hub account (you cannot publish without a Hub account); (4) object storage = Cloudflare R2 (consistent with the existing temporary images); (5) both `link` and `public` fully go through review.
231
+
232
+ **Still open for discussion**:
233
+ 1. **Content extraction**: should text be extracted from PDF/Office to enable full-text search? (Optional for Phase 2; support markdown/html/text/json first.)
234
+ 2. **Review granularity**: once both `link` and `public` enter the queue, should there be separate queue priorities? (`public` affects SEO/the public surface, so reviewing it first is suggested.)
235
+
236
+ ---
237
+
238
+ *This document is a design proposal; development breakdown and task scheduling begin after review and confirmation.*