@yadsh/dsh-qa-surface 0.6.1 → 0.7.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 (287) hide show
  1. package/README.md +163 -7
  2. package/capability-policy.json +1 -1
  3. package/lib/access/capability-catalog.js +144 -0
  4. package/lib/access/capability-catalog.js.map +1 -0
  5. package/lib/access/model.js +379 -0
  6. package/lib/access/model.js.map +1 -0
  7. package/lib/access/role-repository.js +195 -0
  8. package/lib/access/role-repository.js.map +1 -0
  9. package/lib/access/service.js +380 -0
  10. package/lib/access/service.js.map +1 -0
  11. package/lib/access/skill-metadata.js +234 -0
  12. package/lib/access/skill-metadata.js.map +1 -0
  13. package/lib/account-remotes.js +20 -10
  14. package/lib/account-remotes.js.map +1 -1
  15. package/lib/accounts/errors.js.map +1 -1
  16. package/lib/accounts/file.js.map +1 -1
  17. package/lib/accounts/store.js +202 -3
  18. package/lib/accounts/store.js.map +1 -1
  19. package/lib/admin/conversation-log.js +256 -0
  20. package/lib/admin/conversation-log.js.map +1 -0
  21. package/lib/admin/index.js +17 -0
  22. package/lib/admin/index.js.map +1 -0
  23. package/lib/admin/metrics.js +103 -0
  24. package/lib/admin/metrics.js.map +1 -0
  25. package/lib/admin/paging.js +23 -0
  26. package/lib/admin/paging.js.map +1 -0
  27. package/lib/admin/permissions.js +50 -0
  28. package/lib/admin/permissions.js.map +1 -0
  29. package/lib/admin/quality-store.js +485 -0
  30. package/lib/admin/quality-store.js.map +1 -0
  31. package/lib/admin/queue.js +107 -0
  32. package/lib/admin/queue.js.map +1 -0
  33. package/lib/admin/redaction.js +45 -0
  34. package/lib/admin/redaction.js.map +1 -0
  35. package/lib/admin/service.js +897 -0
  36. package/lib/admin/service.js.map +1 -0
  37. package/lib/admin/session-log.js +142 -0
  38. package/lib/admin/session-log.js.map +1 -0
  39. package/lib/cli.js +9 -6
  40. package/lib/cli.js.map +1 -1
  41. package/lib/client/QaSessionController.js +28 -2
  42. package/lib/client/QaSessionController.js.map +1 -1
  43. package/lib/client/QaSurface.js +143 -5
  44. package/lib/client/QaSurface.js.map +1 -1
  45. package/lib/client/QaTranscriptAdapter.js +1 -0
  46. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  47. package/lib/client/admin/QaAdmin.js +458 -0
  48. package/lib/client/admin/QaAdmin.js.map +1 -0
  49. package/lib/client/admin/format.js +177 -0
  50. package/lib/client/admin/format.js.map +1 -0
  51. package/lib/client/admin/pages/Conversations.js +114 -0
  52. package/lib/client/admin/pages/Conversations.js.map +1 -0
  53. package/lib/client/admin/pages/Overview.js +24 -0
  54. package/lib/client/admin/pages/Overview.js.map +1 -0
  55. package/lib/client/admin/pages/Quality.js +71 -0
  56. package/lib/client/admin/pages/Quality.js.map +1 -0
  57. package/lib/client/admin/pages/Review.js +93 -0
  58. package/lib/client/admin/pages/Review.js.map +1 -0
  59. package/lib/client/admin/pages/Users.js +95 -0
  60. package/lib/client/admin/pages/Users.js.map +1 -0
  61. package/lib/client/admin/routes.js +143 -0
  62. package/lib/client/admin/routes.js.map +1 -0
  63. package/lib/client/admin/shared.js +91 -0
  64. package/lib/client/admin/shared.js.map +1 -0
  65. package/lib/client/admin/styles.js +111 -0
  66. package/lib/client/admin/styles.js.map +1 -0
  67. package/lib/client/components/QaChangelog.js +53 -0
  68. package/lib/client/components/QaChangelog.js.map +1 -1
  69. package/lib/client/components/QaHeader.js +3 -3
  70. package/lib/client/components/QaHeader.js.map +1 -1
  71. package/lib/client/components/QaMessage.js +61 -2
  72. package/lib/client/components/QaMessage.js.map +1 -1
  73. package/lib/client/create-session.js +1 -1
  74. package/lib/client/create-session.js.map +1 -1
  75. package/lib/client/index.js +48 -1
  76. package/lib/client/index.js.map +1 -1
  77. package/lib/client/role/RoleSelector.js +31 -0
  78. package/lib/client/role/RoleSelector.js.map +1 -0
  79. package/lib/client/session-sources.js +37 -1
  80. package/lib/client/session-sources.js.map +1 -1
  81. package/lib/client/settings/card.js +2 -2
  82. package/lib/client/settings/card.js.map +1 -1
  83. package/lib/client/settings/sections.js +0 -1
  84. package/lib/client/settings/sections.js.map +1 -1
  85. package/lib/client/settings-extensions/index.js +1 -0
  86. package/lib/client/settings-extensions/index.js.map +1 -1
  87. package/lib/client/settings-extensions/user-session.js +62 -0
  88. package/lib/client/settings-extensions/user-session.js.map +1 -0
  89. package/lib/client/styles.js +31 -0
  90. package/lib/client/styles.js.map +1 -1
  91. package/lib/client/types.js.map +1 -1
  92. package/lib/client.js +9993 -4848
  93. package/lib/client.js.map +1 -1
  94. package/lib/config-resolvers/defaults.js +0 -2
  95. package/lib/config-resolvers/defaults.js.map +1 -1
  96. package/lib/config.js +0 -249
  97. package/lib/config.js.map +1 -1
  98. package/lib/enforcement/skill-policy.js +172 -0
  99. package/lib/enforcement/skill-policy.js.map +1 -0
  100. package/lib/enforcement/tool-grants.js +151 -0
  101. package/lib/enforcement/tool-grants.js.map +1 -0
  102. package/lib/index.js +224 -42
  103. package/lib/index.js.map +1 -1
  104. package/lib/personal-skills/service.js +10 -3
  105. package/lib/personal-skills/service.js.map +1 -1
  106. package/lib/qa-tools/index.js +4 -0
  107. package/lib/qa-tools/index.js.map +1 -1
  108. package/lib/resolve-config.js +0 -2
  109. package/lib/resolve-config.js.map +1 -1
  110. package/lib/secure-session.js +71 -17
  111. package/lib/secure-session.js.map +1 -1
  112. package/lib/typert.host.js +2237 -202
  113. package/lib/typert.remote-client.d.ts +49 -3
  114. package/lib/typert.remote-client.js +1863 -183
  115. package/lib/types/access/capability-catalog.d.ts +37 -0
  116. package/lib/types/access/model.d.ts +60 -0
  117. package/lib/types/access/role-repository.d.ts +32 -0
  118. package/lib/types/access/service.d.ts +57 -0
  119. package/lib/types/access/skill-metadata.d.ts +53 -0
  120. package/lib/types/account-remotes.d.ts +6 -0
  121. package/lib/types/accounts/errors.d.ts +1 -1
  122. package/lib/types/accounts/file.d.ts +16 -5
  123. package/lib/types/accounts/store.d.ts +83 -3
  124. package/lib/types/admin/conversation-log.d.ts +39 -0
  125. package/lib/types/admin/index.d.ts +24 -0
  126. package/lib/types/admin/metrics.d.ts +29 -0
  127. package/lib/types/admin/paging.d.ts +33 -0
  128. package/lib/types/admin/permissions.d.ts +10 -0
  129. package/lib/types/admin/quality-store.d.ts +82 -0
  130. package/lib/types/admin/queue.d.ts +21 -0
  131. package/lib/types/admin/redaction.d.ts +29 -0
  132. package/lib/types/admin/service.d.ts +105 -0
  133. package/lib/types/admin/session-log.d.ts +53 -0
  134. package/lib/types/client/QaSessionController.d.ts +12 -1
  135. package/lib/types/client/QaSurface.d.ts +7 -1
  136. package/lib/types/client/admin/QaAdmin.d.ts +17 -0
  137. package/lib/types/client/admin/format.d.ts +43 -0
  138. package/lib/types/client/admin/pages/Conversations.d.ts +21 -0
  139. package/lib/types/client/admin/pages/Overview.d.ts +13 -0
  140. package/lib/types/client/admin/pages/Quality.d.ts +18 -0
  141. package/lib/types/client/admin/pages/Review.d.ts +15 -0
  142. package/lib/types/client/admin/pages/Users.d.ts +22 -0
  143. package/lib/types/client/admin/routes.d.ts +60 -0
  144. package/lib/types/client/admin/shared.d.ts +53 -0
  145. package/lib/types/client/admin/styles.d.ts +11 -0
  146. package/lib/types/client/components/QaHeader.d.ts +5 -1
  147. package/lib/types/client/components/QaMessage.d.ts +14 -1
  148. package/lib/types/client/create-session.d.ts +2 -0
  149. package/lib/types/client/role/RoleSelector.d.ts +14 -0
  150. package/lib/types/client/session-sources.d.ts +9 -0
  151. package/lib/types/client/settings/sections.d.ts +0 -1
  152. package/lib/types/client/settings-extensions/index.d.ts +2 -0
  153. package/lib/types/client/settings-extensions/user-session.d.ts +59 -0
  154. package/lib/types/client/types.d.ts +39 -2
  155. package/lib/types/enforcement/skill-policy.d.ts +29 -0
  156. package/lib/types/enforcement/tool-grants.d.ts +84 -0
  157. package/lib/types/index.d.ts +62 -14
  158. package/lib/types/qa-tools/index.d.ts +2 -0
  159. package/lib/types/secure-session.d.ts +10 -1
  160. package/lib/types/types.d.ts +568 -5
  161. package/package.json +2 -2
  162. package/lib/client/settings/sections/documents.js +0 -88
  163. package/lib/client/settings/sections/documents.js.map +0 -1
  164. package/lib/documents/artifacts/ids.js +0 -43
  165. package/lib/documents/artifacts/ids.js.map +0 -1
  166. package/lib/documents/artifacts/manifest.js +0 -66
  167. package/lib/documents/artifacts/manifest.js.map +0 -1
  168. package/lib/documents/artifacts/store.js +0 -169
  169. package/lib/documents/artifacts/store.js.map +0 -1
  170. package/lib/documents/capabilities.js +0 -93
  171. package/lib/documents/capabilities.js.map +0 -1
  172. package/lib/documents/config.js +0 -302
  173. package/lib/documents/config.js.map +0 -1
  174. package/lib/documents/defaults.js +0 -78
  175. package/lib/documents/defaults.js.map +0 -1
  176. package/lib/documents/errors.js +0 -101
  177. package/lib/documents/errors.js.map +0 -1
  178. package/lib/documents/index.js +0 -80
  179. package/lib/documents/index.js.map +0 -1
  180. package/lib/documents/inspect/facts.js +0 -161
  181. package/lib/documents/inspect/facts.js.map +0 -1
  182. package/lib/documents/inspect/zip.js +0 -108
  183. package/lib/documents/inspect/zip.js.map +0 -1
  184. package/lib/documents/markdown/directives.js +0 -135
  185. package/lib/documents/markdown/directives.js.map +0 -1
  186. package/lib/documents/markdown/frontmatter.js +0 -35
  187. package/lib/documents/markdown/frontmatter.js.map +0 -1
  188. package/lib/documents/markdown/normalize.js +0 -113
  189. package/lib/documents/markdown/normalize.js.map +0 -1
  190. package/lib/documents/orchestrator/assets.js +0 -243
  191. package/lib/documents/orchestrator/assets.js.map +0 -1
  192. package/lib/documents/orchestrator/convert-document.js +0 -186
  193. package/lib/documents/orchestrator/convert-document.js.map +0 -1
  194. package/lib/documents/orchestrator/create-document.js +0 -292
  195. package/lib/documents/orchestrator/create-document.js.map +0 -1
  196. package/lib/documents/orchestrator/extract-document.js +0 -162
  197. package/lib/documents/orchestrator/extract-document.js.map +0 -1
  198. package/lib/documents/orchestrator/inspect-document.js +0 -89
  199. package/lib/documents/orchestrator/inspect-document.js.map +0 -1
  200. package/lib/documents/orchestrator/runtime-deps.js +0 -59
  201. package/lib/documents/orchestrator/runtime-deps.js.map +0 -1
  202. package/lib/documents/orchestrator/scope.js +0 -132
  203. package/lib/documents/orchestrator/scope.js.map +0 -1
  204. package/lib/documents/providers/docling.js +0 -247
  205. package/lib/documents/providers/docling.js.map +0 -1
  206. package/lib/documents/providers/libreoffice.js +0 -130
  207. package/lib/documents/providers/libreoffice.js.map +0 -1
  208. package/lib/documents/providers/markitdown.js +0 -89
  209. package/lib/documents/providers/markitdown.js.map +0 -1
  210. package/lib/documents/providers/pandoc.js +0 -161
  211. package/lib/documents/providers/pandoc.js.map +0 -1
  212. package/lib/documents/providers/process.js +0 -164
  213. package/lib/documents/providers/process.js.map +0 -1
  214. package/lib/documents/providers/registry.js +0 -152
  215. package/lib/documents/providers/registry.js.map +0 -1
  216. package/lib/documents/providers/shared.js +0 -75
  217. package/lib/documents/providers/shared.js.map +0 -1
  218. package/lib/documents/runtime.js +0 -114
  219. package/lib/documents/runtime.js.map +0 -1
  220. package/lib/documents/security/file-types.js +0 -188
  221. package/lib/documents/security/file-types.js.map +0 -1
  222. package/lib/documents/security/limits.js +0 -78
  223. package/lib/documents/security/limits.js.map +0 -1
  224. package/lib/documents/security/mime.js +0 -43
  225. package/lib/documents/security/mime.js.map +0 -1
  226. package/lib/documents/security/paths.js +0 -133
  227. package/lib/documents/security/paths.js.map +0 -1
  228. package/lib/documents/templates/registry.js +0 -147
  229. package/lib/documents/templates/registry.js.map +0 -1
  230. package/lib/documents/templates/resolver.js +0 -59
  231. package/lib/documents/templates/resolver.js.map +0 -1
  232. package/lib/documents/tools/convert.js +0 -125
  233. package/lib/documents/tools/convert.js.map +0 -1
  234. package/lib/documents/tools/create.js +0 -187
  235. package/lib/documents/tools/create.js.map +0 -1
  236. package/lib/documents/tools/index.js +0 -41
  237. package/lib/documents/tools/index.js.map +0 -1
  238. package/lib/documents/tools/inspect.js +0 -135
  239. package/lib/documents/tools/inspect.js.map +0 -1
  240. package/lib/documents/tools/shared.js +0 -88
  241. package/lib/documents/tools/shared.js.map +0 -1
  242. package/lib/documents/tools/to-markdown.js +0 -125
  243. package/lib/documents/tools/to-markdown.js.map +0 -1
  244. package/lib/documents/types.js +0 -12
  245. package/lib/documents/types.js.map +0 -1
  246. package/lib/types/client/settings/sections/documents.d.ts +0 -13
  247. package/lib/types/documents/artifacts/ids.d.ts +0 -14
  248. package/lib/types/documents/artifacts/manifest.d.ts +0 -32
  249. package/lib/types/documents/artifacts/store.d.ts +0 -67
  250. package/lib/types/documents/capabilities.d.ts +0 -32
  251. package/lib/types/documents/config.d.ts +0 -27
  252. package/lib/types/documents/defaults.d.ts +0 -161
  253. package/lib/types/documents/errors.d.ts +0 -42
  254. package/lib/types/documents/index.d.ts +0 -63
  255. package/lib/types/documents/inspect/facts.d.ts +0 -43
  256. package/lib/types/documents/inspect/zip.d.ts +0 -28
  257. package/lib/types/documents/markdown/directives.d.ts +0 -39
  258. package/lib/types/documents/markdown/frontmatter.d.ts +0 -15
  259. package/lib/types/documents/markdown/normalize.d.ts +0 -30
  260. package/lib/types/documents/orchestrator/assets.d.ts +0 -55
  261. package/lib/types/documents/orchestrator/convert-document.d.ts +0 -25
  262. package/lib/types/documents/orchestrator/create-document.d.ts +0 -18
  263. package/lib/types/documents/orchestrator/extract-document.d.ts +0 -24
  264. package/lib/types/documents/orchestrator/inspect-document.d.ts +0 -12
  265. package/lib/types/documents/orchestrator/runtime-deps.d.ts +0 -43
  266. package/lib/types/documents/orchestrator/scope.d.ts +0 -52
  267. package/lib/types/documents/providers/docling.d.ts +0 -54
  268. package/lib/types/documents/providers/libreoffice.d.ts +0 -40
  269. package/lib/types/documents/providers/markitdown.d.ts +0 -28
  270. package/lib/types/documents/providers/pandoc.d.ts +0 -42
  271. package/lib/types/documents/providers/process.d.ts +0 -54
  272. package/lib/types/documents/providers/registry.d.ts +0 -68
  273. package/lib/types/documents/providers/shared.d.ts +0 -27
  274. package/lib/types/documents/runtime.d.ts +0 -59
  275. package/lib/types/documents/security/file-types.d.ts +0 -39
  276. package/lib/types/documents/security/limits.d.ts +0 -24
  277. package/lib/types/documents/security/mime.d.ts +0 -13
  278. package/lib/types/documents/security/paths.d.ts +0 -38
  279. package/lib/types/documents/templates/registry.d.ts +0 -50
  280. package/lib/types/documents/templates/resolver.d.ts +0 -30
  281. package/lib/types/documents/tools/convert.d.ts +0 -9
  282. package/lib/types/documents/tools/create.d.ts +0 -14
  283. package/lib/types/documents/tools/index.d.ts +0 -33
  284. package/lib/types/documents/tools/inspect.d.ts +0 -9
  285. package/lib/types/documents/tools/shared.d.ts +0 -77
  286. package/lib/types/documents/tools/to-markdown.d.ts +0 -12
  287. package/lib/types/documents/types.d.ts +0 -294
@@ -1,14 +0,0 @@
1
- /**
2
- * `document_create` — Markdown to DOCX and/or PDF (§8, §34).
3
- *
4
- * This is the tool the agent reaches for instead of driving pandoc and
5
- * LibreOffice itself, which is the whole point of the pipeline: the intent is
6
- * "give me this report as a Word file and a PDF", and the service decides how
7
- * that happens.
8
- */
9
- import type { DocumentRuntime } from "../runtime.js";
10
- export declare const DOCUMENT_CREATE_TOOL = "document_create";
11
- export declare function createDocumentCreateTool(options: {
12
- readonly runtime: DocumentRuntime;
13
- }): import("@deepseek-ai/dsh-tools").ToolDefinition;
14
- //# sourceMappingURL=create.d.ts.map
@@ -1,33 +0,0 @@
1
- /**
2
- * The four agent-facing document tools (§8–§11, §34) and their registration.
3
- *
4
- * Registration is explicit and returns its disposers: the host may register
5
- * them globally (the default) or an agent scope may register the same
6
- * definitions later, which is what a deployment that wants progressive
7
- * disclosure needs. Nothing here decides *whether* document tools are visible;
8
- * that is the deployment's allow-list.
9
- */
10
- import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
11
- import type { DocumentRuntime } from "../runtime.js";
12
- import { DOCUMENT_CONVERT_TOOL } from "./convert.js";
13
- import { DOCUMENT_CREATE_TOOL } from "./create.js";
14
- import { DOCUMENT_INSPECT_TOOL } from "./inspect.js";
15
- import { DOCUMENT_TO_MARKDOWN_TOOL } from "./to-markdown.js";
16
- /** Exact names of the tools this subsystem registers (allow-list contract). */
17
- export declare const DOCUMENT_TOOL_NAMES: readonly string[];
18
- export { DOCUMENT_CONVERT_TOOL, DOCUMENT_CREATE_TOOL, DOCUMENT_INSPECT_TOOL, DOCUMENT_TO_MARKDOWN_TOOL, };
19
- export declare function createDocumentTools(options: {
20
- readonly runtime: DocumentRuntime;
21
- }): ToolDefinition[];
22
- /** Anything that can accept a tool definition; the host's registry facade. */
23
- export interface DocumentToolRegistry {
24
- register(definition: ToolDefinition): () => void;
25
- }
26
- /**
27
- * Register every document tool and return one disposer. `enabled: false` is
28
- * handled by the caller: the surface is then absent rather than inert.
29
- */
30
- export declare function registerDocumentTools(registry: DocumentToolRegistry, options: {
31
- readonly runtime: DocumentRuntime;
32
- }): () => void;
33
- //# sourceMappingURL=index.d.ts.map
@@ -1,9 +0,0 @@
1
- /**
2
- * `document_inspect` — what a document is, without converting it (§11, §34).
3
- */
4
- import type { DocumentRuntime } from "../runtime.js";
5
- export declare const DOCUMENT_INSPECT_TOOL = "document_inspect";
6
- export declare function createDocumentInspectTool(options: {
7
- readonly runtime: DocumentRuntime;
8
- }): import("@deepseek-ai/dsh-tools").ToolDefinition;
9
- //# sourceMappingURL=inspect.d.ts.map
@@ -1,77 +0,0 @@
1
- /**
2
- * What the four document tools share: the calling session's scope, the output
3
- * shapes they render, and the warning formatter.
4
- *
5
- * A tool is a thin adapter. It reads the session's working directory (the
6
- * artifact root and the allowed input roots both derive from it), hands intent
7
- * to the runtime, and renders the structured result for the model. No tool
8
- * knows a backend name beyond the one the result reports.
9
- */
10
- import type { ParameterSchemaSpec } from "@deepseek-ai/dsh-tools";
11
- import type { DocumentScope } from "../orchestrator/scope.js";
12
- import type { DocumentFileResult, DocumentWarning } from "../types.js";
13
- /**
14
- * Model-facing shape of a warning. The tool results carry code, message and
15
- * backend; the diagnostic `details` stay in the manifest, where they are read
16
- * by an operator rather than by the model.
17
- */
18
- export interface ToolWarning {
19
- readonly code: string;
20
- readonly message: string;
21
- readonly backend?: string;
22
- }
23
- export declare function toolWarnings(warnings: readonly DocumentWarning[]): ToolWarning[];
24
- /** Shared output-schema fragment for the `warnings` array of every tool. */
25
- export declare const warningsSchema: {
26
- type: "array";
27
- items: {
28
- type: "object";
29
- additionalProperties: false;
30
- properties: {
31
- code: {
32
- type: "string";
33
- required: true;
34
- };
35
- message: {
36
- type: "string";
37
- required: true;
38
- };
39
- backend: {
40
- type: "string";
41
- };
42
- };
43
- };
44
- };
45
- /** Mutable projection of a produced file for the tool result. */
46
- export declare function toolFiles(files: readonly DocumentFileResult[]): {
47
- format: string;
48
- path: string;
49
- mediaType: string;
50
- size: number;
51
- sha256: string;
52
- status: string;
53
- error?: string;
54
- }[];
55
- /** Structural view of the execution context a tool body needs. */
56
- export interface DocumentToolExec {
57
- readonly signal?: AbortSignal;
58
- readonly agent?: {
59
- readonly session: {
60
- readonly header: {
61
- readonly cwd?: string;
62
- readonly id?: unknown;
63
- };
64
- };
65
- };
66
- }
67
- /**
68
- * Resolve the session scope, failing closed: a session without a working
69
- * directory gets no document access rather than the host process's cwd.
70
- */ export declare function requireDocumentScope(exec: DocumentToolExec): DocumentScope;
71
- export declare function fileParameter(): ParameterSchemaSpec[string];
72
- export declare function formatBytes(bytes: number): string;
73
- export declare function renderWarning(warning: ToolWarning): string;
74
- /** One line per produced file, plus failed formats explicitly named. */
75
- export declare function renderFiles(files: readonly DocumentFileResult[]): string[];
76
- export declare const ARTIFACT_NOTE = "The artifact directory keeps the source, the assets and manifest.json beside the outputs.";
77
- //# sourceMappingURL=shared.d.ts.map
@@ -1,12 +0,0 @@
1
- /**
2
- * `document_to_markdown` — DOCX/PDF to Markdown (§9, §34).
3
- *
4
- * The model gets the extracted text and a path to the full copy; the artifact
5
- * bundle keeps the input, the extracted Markdown and any extracted images.
6
- */
7
- import type { DocumentRuntime } from "../runtime.js";
8
- export declare const DOCUMENT_TO_MARKDOWN_TOOL = "document_to_markdown";
9
- export declare function createDocumentToMarkdownTool(options: {
10
- readonly runtime: DocumentRuntime;
11
- }): import("@deepseek-ai/dsh-tools").ToolDefinition;
12
- //# sourceMappingURL=to-markdown.d.ts.map
@@ -1,294 +0,0 @@
1
- /**
2
- * Public types of the QA Surface document pipeline.
3
- *
4
- * The shapes here are the contract the agent sees (tool inputs and results),
5
- * the contract the artifact store persists (manifest), and the contract the
6
- * providers implement. They are deliberately free of any backend vocabulary:
7
- * a tool result never names pandoc, LibreOffice or Docling, so a provider can
8
- * be replaced without touching a prompt, a skill or a workflow
9
- * (docs/specs/document-pipeline.md §4.1, §22).
10
- */
11
- /** Formats the pipeline can read and write. */
12
- export type DocumentFormat = "md" | "docx" | "pdf";
13
- /** Formats a document can be created in. */
14
- export type CreateFormat = "docx" | "pdf";
15
- /** PDF production route (§14). */
16
- export type PdfMode = "office" | "typst" | "auto";
17
- /** Extraction quality/route selector (§9). */
18
- export type ExtractionMode = "auto" | "fast" | "accurate";
19
- /** OCR policy (§15.2). */
20
- export type OcrMode = "auto" | "off" | "force";
21
- /** Structural classification of an inspected input (§11). */
22
- export type DetectedFormat = "pdf" | "docx" | "docm" | "markdown" | "unknown";
23
- /** Stable warning codes; a warning never turns a success into a failure (§25). */
24
- export type DocumentWarningCode = "OCR_USED" | "TABLE_EXTRACTION_DEGRADED" | "UNSUPPORTED_EMBEDDED_OBJECT" | "FONT_SUBSTITUTED" | "IMAGE_SKIPPED" | "PAGE_LIMIT_REACHED" | "METADATA_PARTIALLY_EXTRACTED" | "BACKEND_FALLBACK_USED" | "FORMAT_FAILED" | "MARKDOWN_TRUNCATED" | "PAGE_SIZE_NOT_APPLIED" | "ASSET_MISSING" | "SOURCE_NOT_RETAINED" | "TEMPLATE_DEFAULTED";
25
- export interface DocumentWarning {
26
- readonly code: DocumentWarningCode;
27
- readonly message: string;
28
- readonly backend?: string;
29
- readonly details?: Readonly<Record<string, unknown>>;
30
- }
31
- /** One artifact file as reported to the agent. */
32
- export interface DocumentFileResult {
33
- readonly format: CreateFormat | "md";
34
- /** Absolute path, inside the session workspace. */
35
- readonly path: string;
36
- readonly mediaType: string;
37
- readonly size: number;
38
- readonly sha256: string;
39
- readonly status: "created" | "failed";
40
- /** Present when `status` is `failed`; the format's own error code. */
41
- readonly error?: string;
42
- }
43
- export interface DocumentAssetInput {
44
- readonly id: string;
45
- /** Workspace-relative or absolute path inside the session scope. */
46
- readonly path?: string;
47
- /** Inline asset content: base64 data URI or raw base64. */
48
- readonly dataRef?: string;
49
- readonly filename?: string;
50
- readonly mimeType?: string;
51
- }
52
- export interface DocumentCreateOptions {
53
- readonly pdfMode?: PdfMode;
54
- readonly pageSize?: string;
55
- readonly locale?: string;
56
- readonly toc?: boolean;
57
- readonly preserveSource?: boolean;
58
- }
59
- export interface DocumentCreateInput {
60
- readonly content: string;
61
- readonly filename?: string;
62
- readonly formats: readonly CreateFormat[];
63
- readonly template?: string;
64
- readonly title?: string;
65
- readonly metadata?: Readonly<Record<string, string>>;
66
- readonly assets?: readonly DocumentAssetInput[];
67
- readonly options?: DocumentCreateOptions;
68
- }
69
- export interface DocumentCreateResult {
70
- readonly artifactId: string;
71
- readonly source?: {
72
- readonly path: string;
73
- readonly mediaType: "text/markdown";
74
- };
75
- readonly files: readonly DocumentFileResult[];
76
- readonly template?: string;
77
- readonly warnings: readonly DocumentWarning[];
78
- readonly manifestPath: string;
79
- }
80
- export interface DocumentToMarkdownInput {
81
- readonly file: string;
82
- readonly mode?: ExtractionMode;
83
- readonly ocr?: OcrMode;
84
- readonly ocrLanguages?: readonly string[];
85
- readonly extractImages?: boolean;
86
- readonly extractTables?: boolean;
87
- readonly preservePageMarkers?: boolean;
88
- readonly outputFilename?: string;
89
- }
90
- export interface DocumentToMarkdownResult {
91
- readonly artifactId: string;
92
- /** Extracted Markdown; truncated to the configured inline budget. */
93
- readonly markdown: string;
94
- readonly markdownPath: string;
95
- readonly assets?: readonly {
96
- readonly path: string;
97
- readonly mediaType: string;
98
- }[];
99
- readonly pages?: number;
100
- readonly backend: string;
101
- readonly warnings: readonly DocumentWarning[];
102
- readonly manifestPath: string;
103
- }
104
- export interface DocumentConvertInput {
105
- readonly file: string;
106
- readonly targetFormat: CreateFormat | "md";
107
- readonly template?: string;
108
- readonly filename?: string;
109
- /** Artifact name of the extracted Markdown when the target is `md`. */
110
- readonly outputFilename?: string;
111
- readonly options?: {
112
- readonly pdfMode?: PdfMode;
113
- readonly ocr?: OcrMode;
114
- };
115
- }
116
- export interface DocumentConvertResult {
117
- readonly artifactId: string;
118
- readonly files: readonly DocumentFileResult[];
119
- readonly source: {
120
- readonly path: string;
121
- readonly format: DocumentFormat;
122
- };
123
- readonly warnings: readonly DocumentWarning[];
124
- readonly manifestPath: string;
125
- }
126
- export interface DocumentInspectInput {
127
- readonly file: string;
128
- }
129
- export interface DocumentInspectResult {
130
- readonly filename: string;
131
- readonly format: DetectedFormat;
132
- readonly mediaType: string;
133
- readonly size: number;
134
- readonly sha256: string;
135
- readonly metadata?: {
136
- readonly title?: string;
137
- readonly author?: string;
138
- readonly createdAt?: string;
139
- readonly modifiedAt?: string;
140
- };
141
- readonly structure?: {
142
- readonly pages?: number;
143
- readonly headings?: number;
144
- readonly tables?: number;
145
- readonly images?: number;
146
- };
147
- readonly encrypted?: boolean;
148
- readonly macroEnabled?: boolean;
149
- readonly warnings: readonly DocumentWarning[];
150
- }
151
- /** Identifies the backend that produced one output, for the manifest (§19). */
152
- export interface BackendInfo {
153
- readonly provider: string;
154
- readonly version?: string;
155
- }
156
- /** Returned by providers that write a file. */
157
- export interface RenderedArtifact {
158
- readonly path: string;
159
- readonly size: number;
160
- readonly sha256: string;
161
- readonly backend: BackendInfo;
162
- readonly warnings: readonly DocumentWarning[];
163
- }
164
- export interface RenderDocxInput {
165
- readonly sourcePath: string;
166
- readonly outputPath: string;
167
- readonly workDir: string;
168
- readonly assetsDir?: string;
169
- /** Reference DOCX resolved from a template, when the template has one. */
170
- readonly referenceDocPath?: string;
171
- readonly templateName?: string;
172
- readonly title?: string;
173
- readonly metadata?: Readonly<Record<string, string>>;
174
- readonly toc?: boolean;
175
- readonly locale?: string;
176
- readonly signal?: AbortSignal;
177
- }
178
- export interface RenderPdfInput {
179
- readonly sourcePath: string;
180
- readonly outputPath: string;
181
- readonly workDir: string;
182
- readonly assetsDir?: string;
183
- readonly templateName?: string;
184
- readonly typstTemplateDir?: string;
185
- readonly pageSize?: string;
186
- readonly title?: string;
187
- readonly metadata?: Readonly<Record<string, string>>;
188
- readonly toc?: boolean;
189
- readonly signal?: AbortSignal;
190
- }
191
- export interface ExtractInput {
192
- readonly inputPath: string;
193
- readonly workDir: string;
194
- /** Directory extracted images are written into, when extraction asks for them. */
195
- readonly assetsDir: string;
196
- readonly ocr: OcrMode;
197
- readonly ocrLanguages?: readonly string[];
198
- readonly extractImages: boolean;
199
- readonly extractTables: boolean;
200
- readonly preservePageMarkers: boolean;
201
- readonly maxPages?: number;
202
- readonly maxImages?: number;
203
- readonly signal?: AbortSignal;
204
- }
205
- export interface ExtractedDocument {
206
- readonly markdown: string;
207
- readonly assets: readonly {
208
- readonly path: string;
209
- readonly mediaType: string;
210
- }[];
211
- readonly pages?: number;
212
- readonly backend: BackendInfo;
213
- readonly warnings: readonly DocumentWarning[];
214
- }
215
- export interface ConvertPdfInput {
216
- readonly inputPath: string;
217
- readonly outputPath: string;
218
- readonly workDir: string;
219
- readonly signal?: AbortSignal;
220
- }
221
- export interface ConvertedDocument {
222
- readonly path: string;
223
- readonly size: number;
224
- readonly sha256: string;
225
- readonly backend: BackendInfo;
226
- readonly warnings: readonly DocumentWarning[];
227
- }
228
- /** §22 provider interfaces. A tool never imports a concrete implementation. */
229
- export interface DocxRenderer {
230
- readonly name: string;
231
- render(input: RenderDocxInput): Promise<RenderedArtifact>;
232
- }
233
- export interface PdfRenderer {
234
- readonly name: string;
235
- render(input: RenderPdfInput): Promise<RenderedArtifact>;
236
- }
237
- export interface DocumentExtractor {
238
- readonly name: string;
239
- supports(format: DocumentFormat): boolean;
240
- extract(input: ExtractInput): Promise<ExtractedDocument>;
241
- }
242
- export interface DocumentConverter {
243
- readonly name: string;
244
- supports(source: DocumentFormat, target: DocumentFormat): boolean;
245
- convert(input: ConvertPdfInput): Promise<ConvertedDocument>;
246
- }
247
- /** Manifest document, written beside every artifact (§19). */
248
- export interface DocumentManifest {
249
- readonly schemaVersion: 1;
250
- readonly artifactId: string;
251
- readonly operation: "document_create" | "document_to_markdown" | "document_convert";
252
- readonly createdAt: string;
253
- readonly input: {
254
- readonly format: DocumentFormat | "unknown";
255
- readonly sha256: string;
256
- readonly filename?: string;
257
- readonly bytes?: number;
258
- };
259
- readonly outputs: readonly {
260
- readonly format: CreateFormat | "md";
261
- readonly path: string;
262
- readonly sha256: string;
263
- readonly size: number;
264
- readonly status: "created" | "failed";
265
- readonly error?: string;
266
- }[];
267
- readonly template?: string;
268
- readonly templateSha256?: string;
269
- readonly backends: Readonly<Record<string, BackendInfo>>;
270
- readonly warnings: readonly DocumentWarning[];
271
- /** Authorization context (§40): what this artifact belongs to. */
272
- readonly scope: {
273
- readonly sessionId?: string;
274
- readonly workspace?: string;
275
- };
276
- }
277
- /** Backend availability, reported by capacity discovery and health (§42). */
278
- export type BackendStatus = "ok" | "unavailable" | "disabled";
279
- export interface DocumentHealth {
280
- readonly status: "ok" | "degraded" | "unavailable";
281
- readonly required: Readonly<Record<string, BackendStatus>>;
282
- readonly optional: Readonly<Record<string, BackendStatus>>;
283
- }
284
- /** Capability discovery (§43). */
285
- export interface DocumentCapabilities {
286
- readonly enabled: boolean;
287
- readonly create: readonly CreateFormat[];
288
- readonly extract: readonly DocumentFormat[];
289
- readonly convert: readonly (readonly [DocumentFormat, DocumentFormat])[];
290
- readonly ocr: boolean;
291
- readonly templates: readonly string[];
292
- readonly pdfModes: readonly PdfMode[];
293
- }
294
- //# sourceMappingURL=types.d.ts.map