@sparkelf/dsh-knowledge-base 0.0.0-stage → 0.1.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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/SKILL.md +147 -0
  3. package/cordis.patch.yml +5 -0
  4. package/i18n/zh.json +10 -0
  5. package/lib/client.js +15976 -0
  6. package/lib/client.js.map +1 -0
  7. package/lib/index.js +5724 -0
  8. package/lib/types/api.d.ts +574 -0
  9. package/lib/types/client/KnowledgeAudit.d.ts +39 -0
  10. package/lib/types/client/KnowledgeContextMenu.d.ts +96 -0
  11. package/lib/types/client/KnowledgeCreateDialog.d.ts +134 -0
  12. package/lib/types/client/KnowledgeFileTree.d.ts +88 -0
  13. package/lib/types/client/KnowledgeHome.d.ts +79 -0
  14. package/lib/types/client/KnowledgeIndexing.d.ts +60 -0
  15. package/lib/types/client/KnowledgeListing.d.ts +160 -0
  16. package/lib/types/client/KnowledgeLoading.d.ts +41 -0
  17. package/lib/types/client/KnowledgeMenuIcon.d.ts +27 -0
  18. package/lib/types/client/KnowledgePanel.d.ts +58 -0
  19. package/lib/types/client/KnowledgePermissionOverview.d.ts +99 -0
  20. package/lib/types/client/KnowledgePermissions.d.ts +47 -0
  21. package/lib/types/client/KnowledgeReferencePicker.d.ts +65 -0
  22. package/lib/types/client/KnowledgeSearch.d.ts +83 -0
  23. package/lib/types/client/KnowledgeSectionHeader.d.ts +71 -0
  24. package/lib/types/client/KnowledgeSelectionBar.d.ts +45 -0
  25. package/lib/types/client/KnowledgeSettings.d.ts +96 -0
  26. package/lib/types/client/KnowledgeSettingsSection.d.ts +21 -0
  27. package/lib/types/client/KnowledgeShareDialog.d.ts +70 -0
  28. package/lib/types/client/KnowledgeTemplates.d.ts +43 -0
  29. package/lib/types/client/KnowledgeTrash.d.ts +62 -0
  30. package/lib/types/client/MenuGlyphs.d.ts +37 -0
  31. package/lib/types/client/departmentFolders.d.ts +57 -0
  32. package/lib/types/client/deployTarget.d.ts +34 -0
  33. package/lib/types/client/index.d.ts +27 -0
  34. package/lib/types/client/knowledgeMenuCopy.d.ts +23 -0
  35. package/lib/types/client/locales.d.ts +438 -0
  36. package/lib/types/client/openInSidebar.d.ts +62 -0
  37. package/lib/types/client/ownerLabel.d.ts +39 -0
  38. package/lib/types/client/permissionRows.d.ts +94 -0
  39. package/lib/types/client/roleSummary.d.ts +47 -0
  40. package/lib/types/client/saveAudit.d.ts +87 -0
  41. package/lib/types/client/useFavorites.d.ts +49 -0
  42. package/lib/types/client/usePinnedPaths.d.ts +39 -0
  43. package/lib/types/client/useTreeState.d.ts +46 -0
  44. package/lib/types/client/useViewMode.d.ts +39 -0
  45. package/lib/types/deploy.d.ts +209 -0
  46. package/lib/types/extract.d.ts +144 -0
  47. package/lib/types/index.d.ts +846 -0
  48. package/lib/types/permissions.d.ts +237 -0
  49. package/lib/types/protocol.d.ts +229 -0
  50. package/lib/types/remote.d.ts +105 -0
  51. package/lib/types/trash.d.ts +142 -0
  52. package/lib/types/viewMetadata.d.ts +20 -0
  53. package/lib/types/views.d.ts +923 -0
  54. package/package.json +109 -4
  55. package/skills/kb-organize/SKILL.md +365 -0
  56. package/skills/kb-organize/i18n/zh.json +10 -0
  57. package/README.md +0 -3
@@ -0,0 +1,438 @@
1
+ /**
2
+ * Knowledge-base Settings copy, in the shape every locale-backed DSH client
3
+ * plugin uses: one English object is the key set, and each other locale is a
4
+ * complete record over that key set so a missing translation fails to compile.
5
+ *
6
+ * @module @sparkelf/dsh-knowledge-base/client/locales
7
+ */
8
+ /** English knowledge-base copy. */
9
+ export declare const en: {
10
+ readonly nav: "Knowledge base";
11
+ readonly title: "Knowledge base";
12
+ readonly description: "Browse the mounted knowledge tree. Retrieval reads those directories directly, so there is nothing to index.";
13
+ readonly storageMode: "Storage";
14
+ readonly storageModeIntro: "Storage location";
15
+ readonly storageModeLocal: "Local";
16
+ readonly storageModeRemote: "Remote (NFS)";
17
+ readonly storageModeLocalHint: "Stored in the workspace. No mount or sync.";
18
+ readonly storageModeRemoteHint: "Documents live in a shared NFS view that is synchronized from the authoritative tree. Requires a mount and a storage host.";
19
+ readonly connection: "Connection";
20
+ readonly host: "Storage host";
21
+ readonly actualRoot: "Authoritative path";
22
+ readonly viewRoot: "Your view";
23
+ readonly mountPoint: "Mounted at";
24
+ readonly backendUnset: "Not configured";
25
+ readonly backendError: "DataOps knowledge API is not answering:";
26
+ readonly status: "Status";
27
+ readonly visibleFiles: "Visible files";
28
+ readonly unknown: "Unknown";
29
+ readonly lastSync: "Last synced";
30
+ readonly neverSynced: "Never";
31
+ readonly indexing: "Scanning";
32
+ readonly idle: "Idle";
33
+ readonly actions: "Actions";
34
+ readonly buildIndex: "Rescan";
35
+ readonly refresh: "Refresh";
36
+ readonly loading: "Loading…";
37
+ readonly unavailable: "Knowledge base is unavailable.";
38
+ readonly unavailableDetail: "The plugin could not reach its own Host routes. This state is shown instead of hidden so the failure is diagnosable.";
39
+ readonly unauthorized: "Your DataOps session cannot read the knowledge base.";
40
+ readonly retry: "Retry";
41
+ readonly grants: "Authorized paths";
42
+ readonly grantsEmpty: "No paths are authorized for you yet.";
43
+ readonly grantsManaged: "Authorization is managed in DataOps.";
44
+ readonly menu: "Sections";
45
+ readonly 'menu.search': "Search";
46
+ readonly actionDownload: "Download";
47
+ readonly actionRename: "Rename…";
48
+ readonly actionPin: "Pin";
49
+ readonly actionUnpin: "Unpin";
50
+ readonly actionReference: "Reference in chat";
51
+ readonly actionPermissions: "Permissions…";
52
+ readonly renamePrompt: "New name";
53
+ readonly renameFailed: "Could not rename: the file may already exist or you may not have write access.";
54
+ readonly downloadFailed: "Could not download this file.";
55
+ readonly 'menu.home': "Home";
56
+ readonly 'menu.permissions': "Permissions";
57
+ readonly 'menu.indexing': "Directories & counts";
58
+ readonly 'menu.trash': "Trash";
59
+ readonly brand: "Wanxiang Knowledge";
60
+ readonly collapseRail: "Collapse the sidebar";
61
+ readonly expandRail: "Expand the sidebar";
62
+ readonly sectionKnowledge: "Knowledge base";
63
+ readonly sectionPinned: "Pinned";
64
+ readonly actionFilter: "Filter this tree";
65
+ readonly actionNew: "New knowledge document";
66
+ readonly filterPlaceholder: "Filter by file name…";
67
+ readonly filterNoMatch: "No file in this tree matches that filter.";
68
+ readonly homeNewTitle: "New";
69
+ readonly homeNewBody: "Start a knowledge document from a blank page.";
70
+ readonly homeUploadTitle: "Upload";
71
+ readonly homeUploadBody: "Bring existing files into the knowledge base.";
72
+ readonly homeTemplateTitle: "Templates";
73
+ readonly homeTemplateBody: "Start from a template the team already uses.";
74
+ readonly homeTabRecent: "Recently opened";
75
+ readonly homeTabMine: "Owned by me";
76
+ readonly homeTabShared: "Shared with me";
77
+ readonly homeTabStarred: "Starred";
78
+ readonly homeColTitle: "Title";
79
+ readonly homeColLocation: "Location";
80
+ readonly homeColOwner: "Owner";
81
+ readonly cardItemNewDoc: "New document";
82
+ readonly cardItemNewFolder: "New folder";
83
+ readonly cardItemUploadFile: "Upload file";
84
+ readonly cardItemUploadFolder: "Upload folder";
85
+ readonly cardItemOpenTemplates: "Open template library";
86
+ readonly uploadDone: "Uploaded {n} file(s).";
87
+ readonly uploadPartial: "Uploaded {ok}, failed {failed}: {names}";
88
+ readonly cardNotYet: "Not available in this build yet";
89
+ readonly cardBusyCreating: "Creating...";
90
+ readonly cardCreated: "Created";
91
+ readonly cardCreateFailed: "Could not create it";
92
+ readonly cardNeedsPath: "Enter a name first";
93
+ readonly templateTitle: "Template library";
94
+ readonly templateSearch: "Search templates";
95
+ readonly templateEmpty: "No templates yet. Add one under Manage.";
96
+ readonly templateUnavailable: "Templates could not be read just now. Try again later.";
97
+ readonly templateLoading: "Loading templates...";
98
+ readonly templateClose: "Close";
99
+ readonly templatePick: "Use this template";
100
+ readonly homeColOwnerUnset: "Not recorded";
101
+ readonly homeColCreated: "Created";
102
+ readonly homeColOpened: "Last opened";
103
+ readonly homeEmpty: "Nothing here yet.";
104
+ readonly trashEmpty: "Trash is empty";
105
+ readonly trashPending: "Deleting a document is not enabled yet. The knowledge tree is shared, and how long a deletion is kept is still being decided.";
106
+ readonly mountPointMissing: "The knowledge tree is not mounted in this workspace.";
107
+ readonly viewNotBuilt: "Your visible directory has not been generated yet.";
108
+ readonly viewNotBuiltHint: "It is generated on first read, or from \"Rebuild my visible directory\".";
109
+ readonly path: "Path";
110
+ readonly subjectType: "Principal kind";
111
+ readonly subjectId: "Principal";
112
+ readonly permission: "Permission";
113
+ readonly grant: "Grant";
114
+ readonly granting: "Granting…";
115
+ readonly grantDone: "Granted.";
116
+ readonly grantNeedsPath: "Enter a path and a principal.";
117
+ readonly grantNeedsUser: "A user principal takes a user UUID, not a username.";
118
+ readonly revoke: "Revoke";
119
+ readonly revokeDone: "Revoked.";
120
+ readonly colPrincipal: "Principal";
121
+ readonly colKind: "Kind";
122
+ readonly colPermission: "Permission";
123
+ readonly colResources: "Accessible paths";
124
+ readonly colLatest: "Latest grant";
125
+ readonly actionsUnit: "{count} permission(s)";
126
+ readonly resourcesUnit: "{count} path(s)";
127
+ readonly grantsUnit: "{count} grant(s)";
128
+ readonly grantsByPrincipal: "Authorized by principal";
129
+ readonly grantsByPrincipalHint: "One row per principal: what it may do, and which paths that covers.";
130
+ readonly actionRead: "Read only";
131
+ readonly actionWrite: "Read and write";
132
+ readonly actionManage: "Manage";
133
+ readonly grantedAt: "Granted at";
134
+ readonly 'subject.user': "User";
135
+ readonly 'subject.user.hint': "User UUID, or pick from the list";
136
+ readonly 'subject.role': "Role";
137
+ readonly 'subject.role.hint': "Role code, or pick from the list";
138
+ readonly 'subject.department': "Department";
139
+ readonly 'subject.department.hint': "Department code, or pick from the list";
140
+ readonly 'subject.group': "Group";
141
+ readonly 'subject.group.hint': "Group code, or pick from the list";
142
+ readonly chooseOption: "Choose…";
143
+ readonly pickerUnavailable: "The directory is unavailable; type the identifier instead.";
144
+ readonly rescan: "Rescan";
145
+ readonly referenceFile: "Reference in chat";
146
+ readonly refPickerTitle: "Reference in a conversation";
147
+ readonly refPickerHint: "Choose the conversation that should receive this reference.";
148
+ readonly refPickerSearch: "Filter conversations";
149
+ readonly refPickerNew: "New conversation";
150
+ readonly refPickerNewHint: "Start a fresh conversation with this reference already in the draft.";
151
+ readonly refPickerCreating: "Starting a conversation…";
152
+ readonly refPickerNoSessions: "No conversations yet. Start a new one above.";
153
+ readonly refPickerNoMatch: "No conversation matches that filter.";
154
+ readonly refPickerNoTarget: "The host did not return a conversation to reference.";
155
+ readonly refPickerCreateFailed: "Could not start a conversation. Try again, or pick an existing one.";
156
+ readonly refPickerDone: "Reference added to the conversation draft.";
157
+ readonly refPickerDismiss: "Dismiss";
158
+ readonly pinFile: "Pin";
159
+ readonly unpinFile: "Unpin";
160
+ readonly viewSection: "Visible tree";
161
+ readonly viewExplainer: "Grants decide what a user may read, but the workspace mounts the shared export, so a view must also be built on disk. Sync rebuilds your own view from what DataOps currently allows.";
162
+ readonly viewSync: "Rebuild my visible tree";
163
+ readonly viewSyncing: "Rebuilding…";
164
+ readonly viewSynced: "Checked {considered} paths, {resolved} allowed; linked {linked}, removed {unlinked}.";
165
+ readonly viewSyncFailed: "Could not rebuild the view.";
166
+ readonly permNew: "New grant";
167
+ readonly permNewHint: "Grant a principal access to one path.";
168
+ readonly permCount: "{count} principal(s)";
169
+ readonly overviewByPerson: "By person";
170
+ readonly overviewByResource: "By resource";
171
+ readonly overviewEmpty: "No grants yet. Grant a document or folder to someone to see them here.";
172
+ readonly overviewHeld: "{count} item(s)";
173
+ readonly overviewRoles: "Roles";
174
+ readonly overviewActions: "Actions";
175
+ readonly overviewRolesHeading: "Roles in use";
176
+ readonly overviewNoActions: "None";
177
+ readonly grantDialogHint: "Pick the principal kind first: the backend matches a different identifier per kind.";
178
+ readonly colExpiry: "Valid until";
179
+ readonly expiryNever: "No expiry";
180
+ readonly overviewTabsLabel: "Grant views";
181
+ readonly overviewStatPrincipals: "Principals";
182
+ readonly overviewStatResources: "Paths";
183
+ readonly overviewStatGrants: "Grants";
184
+ readonly overviewStatRoles: "Roles in use";
185
+ readonly overviewColResource: "Resource";
186
+ readonly overviewColHolders: "Who has access";
187
+ readonly overviewColKindOfResource: "Type";
188
+ readonly overviewKindFile: "File";
189
+ readonly overviewKindDirectory: "Folder";
190
+ readonly revokeConfirmTitle: "Revoke this access?";
191
+ readonly revokeConfirmBody: "This removes {count} grant(s) for {name}. The file itself is untouched.";
192
+ readonly revokeConfirmNeeds: "Removes every grant this row lists.";
193
+ readonly confirm: "Confirm";
194
+ readonly cancel: "Cancel";
195
+ readonly revoking: "Revoking…";
196
+ readonly colDirectory: "Directory";
197
+ readonly colFileCount: "Files";
198
+ readonly colSearchable: "Searchable";
199
+ readonly colLastChange: "Last change";
200
+ readonly searchableYes: "Searchable";
201
+ readonly searchableNo: "Not searchable";
202
+ readonly partialCountMark: "+";
203
+ readonly partialCountHint: "A subdirectory could not be read, so this count is a lower bound.";
204
+ readonly rootDirectory: "All files";
205
+ readonly directoriesEmpty: "No directory to report yet.";
206
+ readonly rescanAll: "Rescan all";
207
+ readonly rescanRow: "Rescan";
208
+ readonly colTrashName: "Name";
209
+ readonly colTrashOrigin: "Original location";
210
+ readonly colTrashDeletedAt: "Deleted at";
211
+ readonly colTrashRetention: "Retention left";
212
+ readonly trashRestore: "Restore";
213
+ readonly trashRestored: "Restored. If access to it was withdrawn while it sat here, it stays hidden.";
214
+ readonly trashNoExpiry: "No expiry";
215
+ readonly trashReadFailed: "Could not read the trash.";
216
+ readonly trashWriteFailed: "That did not go through.";
217
+ readonly trashPurge: "Delete permanently";
218
+ readonly trashEmptyRow: "Trash is empty";
219
+ readonly permissionReadable: "You may read this";
220
+ readonly permissionDenied: "Not authorized for you";
221
+ readonly rescanning: "Scanning…";
222
+ readonly rescanDone: "Rescanned.";
223
+ readonly rescanFailed: "Could not rescan.";
224
+ readonly notMounted: "Not mounted";
225
+ readonly previewEmpty: "Select a file to preview it.";
226
+ readonly previewBinary: "This file is binary and cannot be shown as text.";
227
+ readonly previewBinarySize: "This file is binary and cannot be shown as text. {size} bytes.";
228
+ readonly previewFailed: "Could not read this file.";
229
+ readonly previewTruncated: "This file is large; only the start is shown.";
230
+ readonly modifiedAt: "Modified";
231
+ readonly openedInSidebar: "Opened in the file window on the right.";
232
+ readonly copyCode: "Copy";
233
+ readonly copiedCode: "Copied";
234
+ readonly retrieval: "Retrieval";
235
+ readonly recentFiles: "Files, newest changes shown with their time";
236
+ readonly searchPlaceholder: "Search by file name or content…";
237
+ readonly searching: "Searching…";
238
+ readonly searchEmpty: "No document matches that term.";
239
+ readonly treeEmpty: "No documents in the knowledge base yet.";
240
+ readonly searchFailed: "Search failed.";
241
+ readonly filesUnit: "files";
242
+ readonly indexStarted: "Rescan started.";
243
+ readonly indexFailed: "Could not scan the directories.";
244
+ readonly readOnly: "Read-only here";
245
+ readonly deploy: "Deployment";
246
+ readonly deployIntro: "Prepare document parsing and the shared storage export. Every step is safe to run again.";
247
+ readonly deployHost: "Target host";
248
+ readonly deployNoHosts: "No SSH hosts are configured";
249
+ readonly deployHostsError: "Could not read the SSH host list:";
250
+ readonly deployNoCredential: "This host has no credential configured. Add one in the SSH Manager first.";
251
+ readonly deployRun: "Run";
252
+ readonly deployRunning: "Running…";
253
+ readonly deploySucceeded: "Succeeded";
254
+ readonly deployFailed: "Failed";
255
+ readonly 'step.probe': "Check environment";
256
+ readonly 'step.mineru-install': "Install MinerU and models";
257
+ readonly 'step.mineru-service': "Start the parsing service";
258
+ readonly 'step.mineru-verify': "Verify parsing";
259
+ readonly 'step.nfs-deploy': "Deploy the storage export";
260
+ readonly 'step.nfs-verify': "Verify hardlinks across NFS";
261
+ readonly outlineTitle: "Outline";
262
+ readonly gridRoot: "Knowledge base";
263
+ readonly viewList: "List";
264
+ readonly viewGrid: "Grid";
265
+ readonly viewExplorer: "System file tree";
266
+ readonly filesSelected: "{count} selected";
267
+ readonly moveSelected: "Move to…";
268
+ readonly pinSelected: "Pin";
269
+ readonly clearSelection: "Clear";
270
+ readonly moveFailed: "Could not move: {reason}";
271
+ readonly 'menu.settings': "Settings";
272
+ readonly settingsReviewHeading: "Review before publishing";
273
+ readonly settingsReviewHint: "";
274
+ readonly settingsReviewLabel: "Require review";
275
+ readonly settingsReviewOn: "On";
276
+ readonly settingsReviewOff: "Off";
277
+ readonly settingsReadOnly: "You can read these settings but not change them: changing review requires write access.";
278
+ readonly settingsLoading: "Loading settings...";
279
+ readonly settingsLoadFailed: "Could not read the settings.";
280
+ readonly settingsSaved: "Saved.";
281
+ readonly settingsSaveFailed: "Could not save the setting.";
282
+ readonly settingsPendingHeading: "Waiting for review";
283
+ readonly settingsPendingHint: "";
284
+ readonly settingsPendingEmpty: "Nothing is waiting for review.";
285
+ readonly pendingReadOnly: "You can see the queue but not decide it: approving or rejecting requires write access.";
286
+ readonly pendingApproved: "Approved and published.";
287
+ readonly pendingRejected: "Rejected and discarded.";
288
+ readonly pendingDecideFailed: "Could not record the decision.";
289
+ readonly colPendingWhen: "Submitted";
290
+ readonly colPendingSubmitter: "Submitter";
291
+ readonly colPendingTarget: "Target";
292
+ readonly colPendingSize: "Size";
293
+ readonly colPendingDecision: "Decision";
294
+ readonly pendingApprove: "Approve";
295
+ readonly pendingReject: "Reject";
296
+ readonly auditActionApprove: "Approve";
297
+ readonly auditActionReject: "Reject";
298
+ readonly auditOutcomeRejected: "Rejected";
299
+ readonly settingsAuditHeading: "Audit trail";
300
+ readonly settingsAuditHint: "";
301
+ readonly settingsAuditEmpty: "No recorded changes yet.";
302
+ readonly colAuditWhen: "When";
303
+ readonly colAuditActor: "Actor";
304
+ readonly colAuditAction: "Action";
305
+ readonly colAuditTarget: "Target";
306
+ readonly colAuditOutcome: "Result";
307
+ readonly auditActionCreate: "Create";
308
+ readonly auditActionUpload: "Upload";
309
+ readonly auditActionMove: "Move";
310
+ readonly auditActionEdit: "Edit";
311
+ readonly auditOutcomeApplied: "Applied";
312
+ readonly auditOutcomePending: "Pending review";
313
+ readonly storageProtocol: "Protocol";
314
+ readonly protocolNfs: "NFS";
315
+ readonly protocolSshfs: "SSHFS";
316
+ readonly protocolNfsHint: "Mounts the export directly. Needs the storage host to accept NFS from this host.";
317
+ readonly protocolSshfsHint: "Mounts over SSH. Use it where NFS cannot reach, such as a host behind NAT.";
318
+ readonly nfsServer: "NFS server";
319
+ readonly nfsServerPlaceholder: "e.g. 10.0.0.5";
320
+ readonly sshHost: "Host";
321
+ readonly sshHostPlaceholder: "e.g. 154.201.72.205";
322
+ readonly sshUser: "User";
323
+ readonly sshUserPlaceholder: "e.g. root";
324
+ readonly sshPort: "Port";
325
+ readonly sshRemotePath: "Remote path";
326
+ readonly sshRemotePathPlaceholder: "e.g. /srv/kb-nfs";
327
+ readonly sshMountOptions: "Mount options";
328
+ readonly sshMountOptionsPlaceholder: "e.g. ro,allow_other";
329
+ readonly sshKey: "Private key";
330
+ readonly sshKeyUnset: "Not set";
331
+ readonly sshKeyConfigured: "Configured";
332
+ readonly sshKeyMissing: "Not configured";
333
+ readonly save: "Save";
334
+ readonly saving: "Saving...";
335
+ readonly savedOk: "Saved.";
336
+ readonly savedRestart: "Mount changes take effect after the workspace container restarts.";
337
+ readonly saveBadPort: "Port must be a whole number between 1 and 65535.";
338
+ readonly bucketGlobal: "Everyone";
339
+ readonly bucketDepartment: "Department";
340
+ readonly bucketPersonal: "Personal";
341
+ readonly 'step.nfs-mount': "Mount the storage export";
342
+ readonly 'step.sshfs-mount': "Mount the share over SSHFS";
343
+ readonly 'step.sshfs-verify': "Verify the SSHFS mount";
344
+ readonly deployLocalOnly: "Deployment steps run on a remote host. This workspace stores documents locally, so there is nothing to deploy.";
345
+ readonly settingsMineruHeading: "MinerU service address";
346
+ readonly settingsMineruHint: "Where documents are parsed. Leave it empty to use the port this deployment was configured with.";
347
+ readonly settingsMineruPlaceholder: "Leave empty to derive from the configured port";
348
+ readonly settingsMineruDerived: "Currently derived from the configured port.";
349
+ readonly settingsMineruExplicit: "Currently using the address above.";
350
+ readonly settingsSave: "Save";
351
+ readonly settingsSaving: "Saving…";
352
+ readonly ownerGlobal: "Everyone";
353
+ readonly ownerSelf: "Me";
354
+ readonly favoriteMark: "Favorited";
355
+ readonly actionCopy: "Copy";
356
+ readonly actionCut: "Cut";
357
+ readonly actionPaste: "Paste";
358
+ readonly actionPasteCopy: "Paste as copy";
359
+ readonly actionPasteCut: "Paste as move";
360
+ readonly actionDelete: "Delete";
361
+ readonly actionFavorite: "Add to favorites";
362
+ readonly actionUnfavorite: "Remove from favorites";
363
+ readonly actionShare: "Share";
364
+ readonly pasteFailed: "Could not paste.";
365
+ readonly deleteFailed: "Could not delete.";
366
+ readonly templateSubtitle: "Start from a document your team already agreed on.";
367
+ readonly templateTabLibrary: "Templates";
368
+ readonly templateTabManage: "Manage";
369
+ readonly templateUseInto: "Create in";
370
+ readonly templateUsing: "Copying…";
371
+ readonly templateUsed: "Created {path}";
372
+ readonly templateUseFailed: "Could not use this template.";
373
+ readonly templateNoMatch: "No template matches that search.";
374
+ readonly templateUnavailableReason: "Templates could not be read: {reason}";
375
+ readonly templateFileBadge: "file";
376
+ readonly templateAdd: "Add template";
377
+ readonly templateEdit: "Edit";
378
+ readonly templateRemove: "Take offline";
379
+ readonly templateManageEmpty: "No templates yet. Add one to get started.";
380
+ readonly templateName: "Name";
381
+ readonly templateNamePlaceholder: "For example: weekly report";
382
+ readonly templateDescription: "Description";
383
+ readonly templateDescriptionPlaceholder: "One line about when to use it";
384
+ readonly templateCategory: "Category";
385
+ readonly templateCategoryPlaceholder: "For example: report";
386
+ readonly templateTags: "Tags";
387
+ readonly templateTagsPlaceholder: "Comma separated, optional";
388
+ readonly templateDocument: "Document";
389
+ readonly templateFileChosen: "Using {name}";
390
+ readonly templateFileKept: "Keeping the stored file: {name}";
391
+ readonly templateFileUnreadable: "Could not read that file.";
392
+ readonly templateNeedTitle: "Give the template a name.";
393
+ readonly templateNeedFile: "Choose a document for the template.";
394
+ readonly templateSave: "Save";
395
+ readonly templateSaving: "Saving…";
396
+ readonly templateSaved: "Template saved.";
397
+ readonly templateSaveFailed: "Could not save the template.";
398
+ readonly templateRemoveTitle: "Take this template offline?";
399
+ readonly templateRemoveBody: "\"{name}\" will stop appearing in the library. The document is removed too.";
400
+ readonly templateRemoved: "Template taken offline.";
401
+ readonly templateRemoveFailed: "Could not take the template offline.";
402
+ readonly 'menu.audit': "Audit";
403
+ readonly auditTabReview: "Review";
404
+ readonly auditTabLog: "Log";
405
+ readonly auditTabsLabel: "Audit views";
406
+ readonly readFailed: "Could not read the authorization list.";
407
+ readonly grantFailed: "Could not grant access.";
408
+ readonly revokeFailed: "Could not revoke access.";
409
+ readonly createDialogHint: "Name it, then choose where it goes.";
410
+ readonly createUploadHint: "Choose files, then where they go.";
411
+ readonly createName: "Name";
412
+ readonly createDocPlaceholder: "For example: meeting-notes";
413
+ readonly createFolderPlaceholder: "For example: 2026-specs";
414
+ readonly createDestinationPicker: "Location";
415
+ readonly createDestination: "Destination";
416
+ readonly createAtRoot: "Top level";
417
+ readonly createAtUp: "Up one level";
418
+ readonly createLoading: "Loading folders…";
419
+ readonly createNoSubfolders: "No folders inside this one.";
420
+ readonly createListingFailed: "Could not list this folder; you can still create here.";
421
+ readonly createWillCreate: "Will create: {path}";
422
+ readonly createSubmit: "Create";
423
+ readonly createUpload: "Upload";
424
+ readonly createProgress: "Uploading {done}/{total}…";
425
+ readonly createPickFiles: "Choose at least one file.";
426
+ readonly createFiles: "Files";
427
+ readonly createMoreFiles: "+{n} more";
428
+ readonly createDone: "Created {path}";
429
+ readonly createNameEmpty: "Enter a name.";
430
+ readonly createNameSeparator: "A name cannot contain / or \\";
431
+ readonly createNameTraversal: "A name cannot be . or ..";
432
+ readonly deployAboutRemote: "What remote deployment does";
433
+ readonly deployAboutRemoteBody: "A remote deployment syncs documents from a shared NFS or SSHFS export. Its wizard prepares that host, installs the parsing service, and verifies the mount.";
434
+ };
435
+ /** Stable key set shared by every knowledge-base locale. */
436
+ export type KnowledgeKey = keyof typeof en;
437
+ /** Chinese knowledge-base copy. */
438
+ export declare const zh: Record<KnowledgeKey, string>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Open a knowledge document in the product's own right-hand file window.
3
+ *
4
+ * The knowledge page does not draw a document preview of its own. Opening a document
5
+ * hands it to the host's sidebar, which is the surface every other file in the
6
+ * workspace opens into: tab strip, path input, preview/edit toggle, save, refresh,
7
+ * outline. The knowledge page owns none of that chrome.
8
+ *
9
+ * Two host services are involved, both published before any panel mounts:
10
+ *
11
+ * - `sidebarRight` (`ui-sidebar-right`) owns the column. Its `openResource` claims the
12
+ * address, places it, and **reveals the column in the same step** -- the column
13
+ * expands as part of opening, so a document handed to it cannot land in a collapsed
14
+ * panel the reader never sees.
15
+ * - `sidebarRightTabs` is the tab-type registry, whose ranking decides which kind
16
+ * claims a file address. Asking it keeps this open on the host's normal path instead
17
+ * of hard-coding a kind.
18
+ *
19
+ * The address is built with the official `fileAddressFor`, so a document opened from
20
+ * here dedupes against the tab the chat file-link path already opened for the same
21
+ * file rather than opening a second tab onto it.
22
+ *
23
+ * @module @sparkelf/dsh-knowledge-base/client
24
+ */
25
+ /** Outcome of asking the host to show a document. */
26
+ export type OpenOutcome = 'opened' | 'no-context' | 'no-registry' | 'unclaimed' | 'no-column';
27
+ /**
28
+ * Ask the host to open a document in its right-hand file window.
29
+ *
30
+ * @param ctx - the client context the page was injected with.
31
+ * @param sessionId - the conversation the sidebar column is scoped to.
32
+ * @param cwd - the session's workspace root, used to shorten the address to a
33
+ * session-relative one so it dedupes against chat-opened tabs.
34
+ * @param absolutePath - the document's absolute path inside the workspace.
35
+ * @returns Why it did or did not open; the caller reports the failure rather than
36
+ * appearing to do nothing.
37
+ */
38
+ export declare function openInSidebar(ctx: unknown, sessionId: string | undefined, cwd: string | undefined, absolutePath: string): OpenOutcome;
39
+ /**
40
+ * Return the right column's width to the page.
41
+ *
42
+ * Called when the knowledge page stops showing a document. It is deliberately separate
43
+ * from {@link openInSidebar} rather than a mode flag: the two states need different
44
+ * frames, and closing the track is what restores the page's own width. A host without
45
+ * the layout service is left alone -- the page simply keeps whatever it had.
46
+ * @param ctx - the client context the page runs in.
47
+ */
48
+ /**
49
+ * Report whether the host's right column is currently expanded.
50
+ *
51
+ * The page uses this to decide whether it may keep its own content column: a document
52
+ * opened in the reader means the page's column is redundant, but only while the reader
53
+ * is actually on screen. Reading it live (instead of tracking it in React state) keeps
54
+ * the page and the frame from disagreeing when the reader closes the column themselves.
55
+ * A host without the column service reports `false`, which keeps the page's own layout.
56
+ * @param ctx - the client context the page runs in.
57
+ * @returns whether the column is expanded right now.
58
+ */
59
+ export declare function readColumnExpanded(ctx: unknown): boolean;
60
+ export declare function closeSidebar(ctx: unknown): void;
61
+ /** Whether a failure means the host's right column is simply not on this profile. */
62
+ export declare function isHostMissing(outcome: OpenOutcome): boolean;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Who a knowledge document belongs to, derived from where it is stored.
3
+ *
4
+ * The list route reports a path and a location, not an owner: ownership is a property of
5
+ * the bucket, and every rule below is a rule about that bucket. Keeping the derivation
6
+ * here (rather than in the row renderer) does two things. It stays testable without a
7
+ * DOM, and it keeps the answer honest — nothing is invented when the information is not
8
+ * there, because a wrong owner is worse than an unflattering one.
9
+ *
10
+ * @module @sparkelf/dsh-knowledge-base/client/ownerLabel
11
+ */
12
+ /** What the caller knows about itself, as far as ownership is concerned. */
13
+ export interface OwnerContext {
14
+ /** The caller's DataOps id, so `personal/<id>` can be recognised as one's own folder. */
15
+ callerId?: string;
16
+ /** The caller's own department code, for naming the department bucket. */
17
+ departmentCode?: string;
18
+ /** The caller's own department name; falls back to the code when absent. */
19
+ departmentName?: string;
20
+ }
21
+ /** One resolved owner cell. */
22
+ export interface OwnerLabel {
23
+ /** Which rule produced the label, so the renderer can style it without re-parsing. */
24
+ kind: 'global' | 'department' | 'self' | 'person' | 'unknown';
25
+ /** The text to show. */
26
+ label: string;
27
+ }
28
+ /**
29
+ * Resolve the owner of one document.
30
+ *
31
+ * `labels` carries the three strings this module cannot know: what to call the shared
32
+ * bucket, what to call the caller's own folder, and what to show when a path is outside
33
+ * every bucket. Passing them in keeps the module free of locale plumbing.
34
+ */
35
+ export declare function ownerLabelOf(relPath: string, context: OwnerContext, labels: {
36
+ global: string;
37
+ self: string;
38
+ unknown: string;
39
+ }): OwnerLabel;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The pure half of the permissions overview: how one grant table reads two ways.
3
+ *
4
+ * Kept apart from the rendering module for a real reason, not for tidiness: a
5
+ * component module imports the primitives package, which imports CSS, and a Node
6
+ * test runner cannot load a `.css` file. The grouping rules are the part worth
7
+ * testing without a DOM, so they live somewhere a plain import can reach.
8
+ *
9
+ * @module @sparkelf/dsh-knowledge-base/client/permissionRows
10
+ */
11
+ import type { GrantView, KnowledgeGrantSubjectType } from '../api.ts';
12
+ /** One person's holdings, as the person view renders them. */
13
+ export interface PersonHoldings {
14
+ /** Principal id the grants name. */
15
+ principalId: string;
16
+ /** Principal kind, so the type column can name it. */
17
+ principalType: KnowledgeGrantSubjectType;
18
+ /** Display name when a directory entry resolved one, else the id. */
19
+ label: string;
20
+ /** Distinct paths this person may touch. */
21
+ paths: string[];
22
+ /** Which actions the person holds, collapsed so a full house reads `all`. */
23
+ actions: string[];
24
+ /**
25
+ * Roles the person reaches through a `role` grant they belong to.
26
+ *
27
+ * Empty when the directory does not know the membership: a role grant names the
28
+ * ROLE, not the people in it, so this is only populated when a directory entry
29
+ * declared the membership.
30
+ */
31
+ roles: string[];
32
+ /** Most recent grant instant across this person's rows, ISO-8601. */
33
+ latestAt: string;
34
+ /** The grants this row covers, so a revoke can name exactly what it removes. */
35
+ grants: GrantView[];
36
+ }
37
+ /** One resource and everyone who may reach it. */
38
+ export interface ResourceHoldings {
39
+ /** Path, relative to the mount point. */
40
+ relPath: string;
41
+ /** Whether it is a file or a directory. */
42
+ kind: 'file' | 'directory';
43
+ /** Everyone holding any action on it, grouped by principal kind. */
44
+ principals: Array<{
45
+ principalType: KnowledgeGrantSubjectType;
46
+ principalId: string;
47
+ label: string;
48
+ actions: string[];
49
+ latestAt: string;
50
+ grants: GrantView[];
51
+ }>;
52
+ }
53
+ /**
54
+ * Collapse a set of action strings into the shortest describing list.
55
+ *
56
+ * Mirrors the server's collapse rule without importing it: this file is bundled
57
+ * for the browser and must not pull the server module in. Keeping the rule in
58
+ * two places is a real cost, so it is stated once here and covered by the same
59
+ * expectations as the server's own test.
60
+ *
61
+ * @param actions - raw action strings from grants.
62
+ * @returns `['all']` when everything is held, else the concrete subset in order.
63
+ */
64
+ export declare function summarizeActions(actions: readonly string[]): string[];
65
+ /**
66
+ * Group grants by the principal they name.
67
+ *
68
+ * A principal appearing in several grants is one row: "what does 张三 have" is a
69
+ * question about a person, and splitting them across rows because they hold two
70
+ * paths would answer it wrong.
71
+ *
72
+ * @param grants - the grant table.
73
+ * @param labels - display names by `principalType:principalId`, optional.
74
+ * @returns one entry per principal, ordered by label then id.
75
+ */
76
+ export declare function groupHoldingsByPrincipal(grants: readonly GrantView[], labels?: Readonly<Record<string, string>>): PersonHoldings[];
77
+ /**
78
+ * Group grants by the resource they cover.
79
+ *
80
+ * @param grants - the grant table.
81
+ * @param labels - display names by `principalType:principalId`, optional.
82
+ * @returns one entry per path, ordered by path.
83
+ */
84
+ export declare function groupHoldingsByResource(grants: readonly GrantView[], labels?: Readonly<Record<string, string>>): ResourceHoldings[];
85
+ /**
86
+ * Format a grant instant the way the reference table does.
87
+ *
88
+ * DataOps' permission preview prints `YYYY/MM/DD HH:mm` and a dash for a missing
89
+ * value, so a reader comparing the two surfaces sees the same date. The raw
90
+ * ISO-8601 string the API returns is not that.
91
+ * @param value - ISO-8601 instant, or an empty string when the backend sent none.
92
+ * @returns The formatted instant, or a dash when there is nothing to show.
93
+ */
94
+ export declare function formatGrantInstant(value: string): string;