@taskforcehq/taskforce 0.3.328 → 0.3.329

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 (264) hide show
  1. package/dist/Taskforce.module.css +233 -34
  2. package/dist/TaskforceCore.js +237 -230
  3. package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.js +1 -1
  4. package/dist/cli.js +34 -0
  5. package/dist/cliCloudTargetGuard.d.ts +5 -0
  6. package/dist/cliCloudTargetGuard.js +11 -0
  7. package/dist/components/features/AnnotatedAttachmentWorkspace.js +24 -8
  8. package/dist/components/features/TaskSettings.d.ts +12 -1
  9. package/dist/components/features/TaskSettings.js +147 -40
  10. package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +1 -1
  11. package/dist/components/features/planning/PlanningModule.js +2 -5
  12. package/dist/components/features/planning/PlanningTaskOrderList.d.ts +1 -1
  13. package/dist/components/features/planning/PlanningTaskOrderList.js +17 -6
  14. package/dist/components/features/planning/planningTaskArrangement.d.ts +1 -0
  15. package/dist/components/features/planning/planningTaskArrangement.js +5 -5
  16. package/dist/components/features/taskforceAgentEditorModel.js +3 -1
  17. package/dist/components/task/TaskCard.d.ts +5 -0
  18. package/dist/components/task/TaskCard.js +65 -10
  19. package/dist/components/task/TaskImageReviews.js +14 -5
  20. package/dist/components/task/TaskKanban.d.ts +6 -1
  21. package/dist/components/task/TaskKanban.js +152 -6
  22. package/dist/components/task/TaskList.d.ts +5 -0
  23. package/dist/components/task/TaskList.js +3 -3
  24. package/dist/components/ui/PasswordInput.d.ts +6 -0
  25. package/dist/components/ui/PasswordInput.js +11 -0
  26. package/dist/components/ui/TopNoticeLayer.js +1 -1
  27. package/dist/components/views/AppShellHeader.js +32 -11
  28. package/dist/components/views/PlanComparisonPage.js +12 -0
  29. package/dist/components/views/StandaloneLayout.js +7 -31
  30. package/dist/components/views/WidgetView.js +3 -3
  31. package/dist/components/views/panels/PlanningDrawer.js +5 -12
  32. package/dist/components/views/standalone/modals/AccountSettingsModal.js +26 -17
  33. package/dist/config/envSchema.js +12 -0
  34. package/dist/config/localServiceRuntimeContract.d.ts +13 -0
  35. package/dist/config/localServiceRuntimeContract.js +135 -0
  36. package/dist/core/AiProfileService.js +46 -8
  37. package/dist/core/DeletedTaskLifecycleService.d.ts +1 -0
  38. package/dist/core/DeletedTaskLifecycleService.js +37 -6
  39. package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +3 -2
  40. package/dist/core/TaskAttachmentLinksDurableMutationService.js +33 -9
  41. package/dist/core/Taskforce.d.ts +62 -2
  42. package/dist/core/Taskforce.js +635 -32
  43. package/dist/core/types.d.ts +6 -0
  44. package/dist/hooks/sync/useDurableLocalOutboxDrain.d.ts +1 -1
  45. package/dist/hooks/sync/useDurableTaskCreateMutation.js +1 -1
  46. package/dist/hooks/sync/useDurableTaskMetadataMutation.d.ts +1 -0
  47. package/dist/hooks/sync/useDurableTaskMetadataMutation.js +1 -0
  48. package/dist/hooks/sync/useDurableTaskStatusMutation.d.ts +1 -0
  49. package/dist/hooks/tasks/taskHttpMutation.js +1 -0
  50. package/dist/hooks/tasks/useCloudTaskSearch.d.ts +12 -0
  51. package/dist/hooks/tasks/useCloudTaskSearch.js +71 -0
  52. package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.d.ts +16 -0
  53. package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.js +197 -0
  54. package/dist/hooks/tasks/useTaskEditorNavigation.d.ts +16 -3
  55. package/dist/hooks/tasks/useTaskEditorNavigation.js +72 -13
  56. package/dist/hooks/tasks/useTaskFormActions.d.ts +6 -0
  57. package/dist/hooks/tasks/useTaskFormActions.js +65 -12
  58. package/dist/hooks/ui/useSettingsModel.d.ts +24 -2
  59. package/dist/hooks/ui/useSettingsModel.js +13 -2
  60. package/dist/hooks/ui/useSettingsPersistence.d.ts +12 -1
  61. package/dist/hooks/ui/useSettingsPersistence.js +74 -47
  62. package/dist/hooks/useFilterSort.d.ts +7 -3
  63. package/dist/hooks/useFilterSort.js +15 -5
  64. package/dist/hooks/useTaskData.d.ts +10 -1
  65. package/dist/hooks/useTaskData.js +216 -7
  66. package/dist/hooks/useTaskMutations.d.ts +10 -2
  67. package/dist/hooks/useTaskMutations.js +223 -43
  68. package/dist/hooks/useTaskforce.d.ts +37 -9
  69. package/dist/hooks/useTaskforce.js +349 -39
  70. package/dist/hooks/useUiNotice.d.ts +4 -0
  71. package/dist/hooks/useUiNotice.js +4 -0
  72. package/dist/mcp/adminWorkspaceRegistrar.js +3 -3
  73. package/dist/mcp/documentAssetRegistrar.js +44 -35
  74. package/dist/mcp/documentHelpers.d.ts +1 -0
  75. package/dist/mcp/documentHelpers.js +7 -3
  76. package/dist/mcp/runtime.js +172 -42
  77. package/dist/mcp/taskPlanningRegistrar.js +41 -38
  78. package/dist/mcp/toolCallCompatibility.js +38 -1
  79. package/dist/mcp/toolCatalog.d.ts +1 -0
  80. package/dist/migrations/taskSchemaMigrations.js +12 -0
  81. package/dist/runtime/appGateDefinitions.d.ts +30 -6
  82. package/dist/runtime/appGateDefinitions.js +6 -6
  83. package/dist/runtime/appGates.d.ts +12 -13
  84. package/dist/runtime/appGates.js +29 -13
  85. package/dist/runtime/nodeAppGates.d.ts +8 -0
  86. package/dist/runtime/nodeAppGates.js +27 -0
  87. package/dist/server/cloudCollectionRead.d.ts +1 -1
  88. package/dist/server/cloudCollectionRead.js +2 -2
  89. package/dist/server/index.d.ts +3 -0
  90. package/dist/server/index.js +15 -3
  91. package/dist/server/localServiceLease.d.ts +3 -0
  92. package/dist/server/localServiceLease.js +9 -1
  93. package/dist/server/localWorkspaceSyncServerRuntime.js +10 -3
  94. package/dist/server/rateLimit.d.ts +1 -0
  95. package/dist/server/rateLimit.js +4 -0
  96. package/dist/server/realtimeSyncWs.js +36 -12
  97. package/dist/server/routes/admin.js +1 -0
  98. package/dist/server/routes/agentRoles.js +3 -2
  99. package/dist/server/routes/agentSkills.js +3 -2
  100. package/dist/server/routes/agents.js +118 -16
  101. package/dist/server/routes/annotatedAttachments.js +3 -2
  102. package/dist/server/routes/auth.js +3 -1
  103. package/dist/server/routes/durableTaskHttpRouters.d.ts +9 -2
  104. package/dist/server/routes/localService.js +2 -0
  105. package/dist/server/routes/primitives.d.ts +2 -0
  106. package/dist/server/routes/syncAuxRoutes.js +5 -2
  107. package/dist/server/routes/syncPullApplyRoutes.js +23 -4
  108. package/dist/server/routes/syncV3FeedRoutes.js +18 -16
  109. package/dist/server/routes/syncV3LocalCaptureRoutes.js +28 -2
  110. package/dist/server/routes/syncV3LocalFeedApplyRoutes.d.ts +1 -0
  111. package/dist/server/routes/syncV3LocalFeedApplyRoutes.js +26 -0
  112. package/dist/server/routes/syncV3OperationRoutes.js +10 -0
  113. package/dist/server/routes/tasks.js +103 -11
  114. package/dist/server/routes/workspaces.js +43 -1
  115. package/dist/server/workspaceDeletionAdmission.d.ts +23 -0
  116. package/dist/server/workspaceDeletionAdmission.js +50 -0
  117. package/dist/service/localServiceCli.js +16 -0
  118. package/dist/service/localServiceClientLifecycle.js +36 -10
  119. package/dist/services/codexAppServerModelGateway.d.ts +112 -0
  120. package/dist/services/codexAppServerModelGateway.js +438 -0
  121. package/dist/services/taskforceAgentMcpBridge.d.ts +7 -1
  122. package/dist/services/taskforceAgentMcpBridge.js +23 -3
  123. package/dist/shared/taskforceAgentDefinition.js +7 -1
  124. package/dist/shared/taskforceAgentModels.d.ts +1 -0
  125. package/dist/shared/taskforceAgentModels.js +30 -1
  126. package/dist/storage/postgresAdapter.d.ts +20 -3
  127. package/dist/storage/postgresAdapter.js +106 -14
  128. package/dist/storage/postgresWorker.js +13 -4
  129. package/dist/storage/postgresWorkerProtocol.d.ts +29 -0
  130. package/dist/storage/postgresWorkerProtocol.js +30 -0
  131. package/dist/sync/cloudSyncApi.d.ts +4 -1
  132. package/dist/sync/cloudSyncApi.js +7 -2
  133. package/dist/sync/contentSyncState.d.ts +1 -1
  134. package/dist/sync/coordinator/localSyncExecutionPermitStore.d.ts +1 -0
  135. package/dist/sync/coordinator/localSyncExecutionPermitStore.js +7 -1
  136. package/dist/sync/coordinator/localWorkspaceSyncRunner.js +6 -2
  137. package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +20 -2
  138. package/dist/sync/engine/workspaceSyncEngineLocalServices.d.ts +4 -0
  139. package/dist/sync/engine/workspaceSyncEngineLocalServices.js +11 -0
  140. package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +11 -0
  141. package/dist/sync/engine/workspaceSyncEngineRemoteServices.js +2 -1
  142. package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +31 -4
  143. package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.d.ts +3 -1
  144. package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +25 -8
  145. package/dist/sync/engine/workspaceSyncEngineTransfers.d.ts +1 -1
  146. package/dist/sync/engine/workspaceSyncEngineTransfers.js +8 -3
  147. package/dist/sync/syncService.d.ts +2 -0
  148. package/dist/sync/syncService.js +4 -1
  149. package/dist/sync/v3/combinedFeedCapability.js +4 -0
  150. package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +2 -0
  151. package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +11 -1
  152. package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +2 -0
  153. package/dist/sync/v3/durableTaskChecklistMutationRouter.js +4 -0
  154. package/dist/sync/v3/durableTaskHttpBulkMutationRouter.d.ts +1 -0
  155. package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +30 -8
  156. package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +5 -3
  157. package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +27 -2
  158. package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +2 -0
  159. package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +47 -7
  160. package/dist/sync/v3/localTaskCreateOutboxService.js +15 -6
  161. package/dist/sync/v3/localTaskMetadataClient.d.ts +1 -0
  162. package/dist/sync/v3/localTaskMetadataClient.js +1 -0
  163. package/dist/sync/v3/localTaskMetadataOutboxHandler.js +5 -1
  164. package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -0
  165. package/dist/sync/v3/localTaskMetadataOutboxService.js +7 -0
  166. package/dist/sync/v3/localTaskRestoreOutboxService.js +14 -6
  167. package/dist/sync/v3/localTaskStatusClient.d.ts +1 -0
  168. package/dist/sync/v3/localTaskStatusClient.js +6 -1
  169. package/dist/sync/v3/localTaskStatusOutboxService.d.ts +2 -0
  170. package/dist/sync/v3/localTaskStatusOutboxService.js +54 -13
  171. package/dist/sync/v3/syncDurabilityStore.d.ts +7 -0
  172. package/dist/sync/v3/syncDurabilityStore.js +31 -11
  173. package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +6 -4
  174. package/dist/sync/v3/taskAttachmentLinksMutationService.js +19 -10
  175. package/dist/sync/v3/taskChecklistMutationService.d.ts +4 -2
  176. package/dist/sync/v3/taskChecklistMutationService.js +4 -0
  177. package/dist/sync/v3/taskCreateMutationService.d.ts +2 -2
  178. package/dist/sync/v3/taskCreateMutationService.js +7 -4
  179. package/dist/sync/v3/taskMetadataMutationService.d.ts +3 -0
  180. package/dist/sync/v3/taskMetadataMutationService.js +4 -0
  181. package/dist/sync/v3/taskRestoreMutationService.d.ts +2 -2
  182. package/dist/sync/v3/taskRestoreMutationService.js +7 -4
  183. package/dist/sync/v3/taskStatusMutationService.d.ts +2 -0
  184. package/dist/sync/v3/taskStatusMutationService.js +4 -0
  185. package/dist/sync/v3/workflowAssignmentSync.d.ts +1 -0
  186. package/dist/sync/v3/workflowAssignmentSync.js +3 -0
  187. package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.d.ts +1 -1
  188. package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +13 -3
  189. package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.d.ts +11 -0
  190. package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.js +27 -10
  191. package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.d.ts +2 -1
  192. package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.js +52 -10
  193. package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +9 -1
  194. package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +8 -3
  195. package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +51 -10
  196. package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +7 -0
  197. package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +30 -18
  198. package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +9 -4
  199. package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +98 -47
  200. package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +10 -0
  201. package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +58 -21
  202. package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +3 -1
  203. package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +18 -0
  204. package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +6 -0
  205. package/dist/sync/v3/workspaceSyncV3FeedProfile.d.ts +1 -1
  206. package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.d.ts +1 -0
  207. package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.js +23 -10
  208. package/dist/sync/v3/workspaceSyncV3NestedTaskApply.d.ts +3 -0
  209. package/dist/sync/v3/workspaceSyncV3NestedTaskApply.js +64 -13
  210. package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.d.ts +9 -0
  211. package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.js +26 -0
  212. package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +15 -5
  213. package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +50 -14
  214. package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.d.ts +2 -1
  215. package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.js +11 -3
  216. package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +2 -0
  217. package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +2 -0
  218. package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +19 -7
  219. package/dist/sync/v3/workspaceSyncV3TaskCommentAudit.js +9 -2
  220. package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.d.ts +7 -0
  221. package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.js +37 -0
  222. package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.d.ts +6 -0
  223. package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.js +9 -0
  224. package/dist/sync/workspacePullFeed.js +2 -1
  225. package/dist/sync/workspaceRepair.d.ts +3 -0
  226. package/dist/sync/workspaceRepair.js +67 -6
  227. package/dist/types.d.ts +47 -1
  228. package/dist/types.js +6 -0
  229. package/dist/ui/assets/{AiIdentityRosterCard-MZs7lVED.js → AiIdentityRosterCard-BZM4aQnM.js} +1 -1
  230. package/dist/ui/assets/AiProfilesModule-BbAEWtHH.js +1 -0
  231. package/dist/ui/assets/AnnotatedAttachmentWorkspace-B68Wg-RV.js +3 -0
  232. package/dist/ui/assets/AnnotatedAttachmentWorkspace-TzYu7pkG.css +1 -0
  233. package/dist/ui/assets/{AssetTraySortControl-Kf1pelSy.js → AssetTraySortControl-C8Rztyal.js} +1 -1
  234. package/dist/ui/assets/{ContextAttachmentManager-B8boOs6Q.js → ContextAttachmentManager-Cj3c7X9y.js} +2 -2
  235. package/dist/ui/assets/{DocumentWorkspace-DXH4XUsB.js → DocumentWorkspace-B5uvzems.js} +1 -1
  236. package/dist/ui/assets/{EntityActivityTimeline-BtSTq0ON.js → EntityActivityTimeline-BVFvCB5R.js} +1 -1
  237. package/dist/ui/assets/PlanningModule-B5DWQOGz.js +1 -0
  238. package/dist/ui/assets/PlansPage-AY4cGWco.js +1 -0
  239. package/dist/ui/assets/TaskContextUpload-DZxTVesW.js +1 -0
  240. package/dist/ui/assets/TaskSettings-BeWAuyZj.js +12 -0
  241. package/dist/ui/assets/{TaskforceAgentsModule-BazdUwxZ.js → TaskforceAgentsModule-BifCYtjR.js} +6 -6
  242. package/dist/ui/assets/{WorkflowManagerModule-DWFspC-o.js → WorkflowManagerModule-DEr5di_r.js} +1 -1
  243. package/dist/ui/assets/index-I5zhdtgt.js +7 -0
  244. package/dist/ui/assets/index-VRFsx3wz.css +1 -0
  245. package/dist/ui/assets/{vendor-icons-BkFLXavV.js → vendor-icons-D9Lpw-j4.js} +1 -1
  246. package/dist/ui/index.html +3 -3
  247. package/dist/utils/taskActivity.d.ts +3 -2
  248. package/dist/utils/taskActivity.js +19 -2
  249. package/dist/utils/taskEditorReconciliation.d.ts +40 -0
  250. package/dist/utils/taskEditorReconciliation.js +217 -0
  251. package/dist/utils/taskNormalization.d.ts +1 -0
  252. package/dist/utils/taskNormalization.js +39 -0
  253. package/dist/utils/taskSearch.js +2 -2
  254. package/dist/utils/uiNotice.d.ts +4 -0
  255. package/package.json +16 -4
  256. package/dist/ui/assets/AiProfilesModule-C3i0LOxe.js +0 -1
  257. package/dist/ui/assets/AnnotatedAttachmentWorkspace-CBRZ8rca.css +0 -1
  258. package/dist/ui/assets/AnnotatedAttachmentWorkspace-DVZk5Tln.js +0 -3
  259. package/dist/ui/assets/PlanningModule-BPVyEa-f.js +0 -1
  260. package/dist/ui/assets/PlansPage-ChqgxALc.js +0 -1
  261. package/dist/ui/assets/TaskContextUpload-CB3ol0sN.js +0 -1
  262. package/dist/ui/assets/TaskSettings-g4ECKNOz.js +0 -12
  263. package/dist/ui/assets/index-BUplSsv_.js +0 -7
  264. package/dist/ui/assets/index-gz2EXuoK.css +0 -1
@@ -2,8 +2,16 @@ import { bindDomainTool } from './toolCatalog.js';
2
2
  function stringProperty(description, enumValues) {
3
3
  return enumValues ? { type: 'string', description, enum: enumValues } : { type: 'string', description };
4
4
  }
5
- function numberProperty(description) {
6
- return { type: 'number', description };
5
+ function boundedNumberProperty(description, minimum, maximum) {
6
+ return { type: 'number', description, minimum, maximum };
7
+ }
8
+ function integerProperty(description, minimum, maximum) {
9
+ return {
10
+ type: 'integer',
11
+ description,
12
+ ...(minimum === undefined ? {} : { minimum }),
13
+ ...(maximum === undefined ? {} : { maximum }),
14
+ };
7
15
  }
8
16
  function booleanProperty(description) {
9
17
  return { type: 'boolean', description };
@@ -17,12 +25,12 @@ function annotatedAttachmentMarkerProperty() {
17
25
  properties: {
18
26
  type: { type: 'string' },
19
27
  kind: { type: 'string' },
20
- x: { type: 'number' },
21
- y: { type: 'number' },
22
- width: { type: 'number' },
23
- height: { type: 'number' },
24
- x2: { type: 'number' },
25
- y2: { type: 'number' },
28
+ x: { type: 'number', minimum: 0, maximum: 1 },
29
+ y: { type: 'number', minimum: 0, maximum: 1 },
30
+ width: { type: 'number', minimum: 0, maximum: 1 },
31
+ height: { type: 'number', minimum: 0, maximum: 1 },
32
+ x2: { type: 'number', minimum: 0, maximum: 1 },
33
+ y2: { type: 'number', minimum: 0, maximum: 1 },
26
34
  text: { type: 'string' },
27
35
  instruction: { type: 'string' },
28
36
  instructionType: { type: 'string' },
@@ -96,11 +104,11 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
96
104
  inputSchema: {
97
105
  properties: {
98
106
  taskId: stringProperty('Task ID or task reference such as T-123.'),
99
- id: stringProperty('Alias for taskId. Task ID or task reference such as T-123.'),
100
107
  attachmentId: stringProperty('Optional attachment descriptor id to include content for one attachment.'),
101
108
  format: stringProperty('Optional read format when attachmentId is provided. Use metadata for descriptors or download for a download URL.', ['text', 'metadata', 'download']),
102
- maxChars: numberProperty('Optional max inline character count for readable text attachments. Longer content is truncated with size metadata and a download hint.'),
109
+ maxChars: integerProperty('Optional max inline character count for readable text attachments. Longer content is truncated with size metadata and a download hint.', 1),
103
110
  },
111
+ required: ['taskId'],
104
112
  },
105
113
  }));
106
114
  register('get_workstream_attachments', (context) => ({
@@ -110,7 +118,7 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
110
118
  id: stringProperty('Workstream ID or workstream reference such as WS-123.'),
111
119
  attachmentId: stringProperty('Optional attachment descriptor id to include content for one attachment.'),
112
120
  format: stringProperty('Optional read format when attachmentId is provided. Use metadata for descriptors or download for a download URL.', ['text', 'metadata', 'download']),
113
- maxChars: numberProperty('Optional max inline character count for readable text attachments. Longer content is truncated with size metadata and a download hint.'),
121
+ maxChars: integerProperty('Optional max inline character count for readable text attachments. Longer content is truncated with size metadata and a download hint.', 1),
114
122
  },
115
123
  required: ['id'],
116
124
  },
@@ -195,7 +203,7 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
195
203
  id: stringProperty('Initiative ID or initiative reference such as IN-123.'),
196
204
  attachmentId: stringProperty('Optional attachment descriptor id to include content for one attachment.'),
197
205
  format: stringProperty('Optional read format when attachmentId is provided. Use metadata for descriptors or download for a download URL.', ['text', 'metadata', 'download']),
198
- maxChars: numberProperty('Optional max inline character count for readable text attachments. Longer content is truncated with size metadata and a download hint.'),
206
+ maxChars: integerProperty('Optional max inline character count for readable text attachments. Longer content is truncated with size metadata and a download hint.', 1),
199
207
  },
200
208
  required: ['id'],
201
209
  },
@@ -229,11 +237,12 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
229
237
  },
230
238
  }));
231
239
  register('search_images', (context) => ({
232
- description: context.describeTool('Search image assets by keyword, title, filename, caption, or I-123 reference. Use this before get_image when you only know a rough identifier.'),
240
+ description: context.describeTool('Search image assets by keyword, title, filename, caption, or I-123 reference. Use offset/limit to continue broad searches, then call get_image for the selected result.'),
233
241
  inputSchema: {
234
242
  properties: {
235
243
  query: stringProperty('Search term for image lookup, including I-123 references.'),
236
- limit: numberProperty('Max images to return.'),
244
+ limit: integerProperty('Page size (default 10; max 50).', 1, 50),
245
+ offset: integerProperty('Non-negative result offset (default 0).', 0),
237
246
  },
238
247
  required: ['query'],
239
248
  },
@@ -242,17 +251,18 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
242
251
  description: context.describeTool('Get a single image by asset id or image reference such as I-123. Use this first when the user references an image, then use get_image_annotations for saved annotation sessions and payloads. When the image is being used for UI, placement, or visual correction feedback, read the saved annotation payload before making changes.'),
243
252
  inputSchema: {
244
253
  properties: {
245
- id: stringProperty('Image asset id or image reference such as I-123.'),
246
- imageId: stringProperty('Alias for id. Image asset id or image reference such as I-123.'),
254
+ imageId: stringProperty('Image asset id or image reference such as I-123.'),
247
255
  },
256
+ required: ['imageId'],
248
257
  },
249
258
  }));
250
259
  register('search_documents', (context) => ({
251
- description: context.describeTool('Search document assets by keyword, title, filename, caption, or D-123 reference. Use this before get_document when you only know a rough identifier. Search results guide the next step into get_document.'),
260
+ description: context.describeTool('Search document assets by keyword, title, filename, caption, or D-123 reference. Use offset/limit to continue broad searches, then call get_document for the selected result.'),
252
261
  inputSchema: {
253
262
  properties: {
254
263
  query: stringProperty('Search term for document lookup, including D-123 references.'),
255
- limit: numberProperty('Max documents to return.'),
264
+ limit: integerProperty('Page size (default 10; max 50).', 1, 50),
265
+ offset: integerProperty('Non-negative result offset (default 0).', 0),
256
266
  },
257
267
  required: ['query'],
258
268
  },
@@ -264,7 +274,7 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
264
274
  documentId: stringProperty('Document asset id or document reference such as D-123.'),
265
275
  includeContent: booleanProperty('When true, include bounded inline text content or a download reference for binary documents.'),
266
276
  format: stringProperty('Optional read mode when including content.', ['metadata', 'text', 'content', 'full', 'download']),
267
- maxChars: numberProperty('Optional max inline character count for readable documents. Longer content is truncated with size metadata and a download hint.'),
277
+ maxChars: integerProperty('Optional max inline character count for readable documents. Longer content is truncated with size metadata and a download hint.', 1),
268
278
  },
269
279
  required: ['documentId'],
270
280
  },
@@ -289,7 +299,6 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
289
299
  inputSchema: {
290
300
  properties: {
291
301
  imageId: stringProperty('Image asset id or image reference such as I-123.'),
292
- imageAssetId: stringProperty('Alias for imageId. Image asset id or image reference such as I-123.'),
293
302
  taskId: stringProperty('Optional task ID or task reference such as T-123 to narrow sessions linked to one task.'),
294
303
  sessionId: stringProperty('Optional annotated attachment session id to include the structured payload for one session.'),
295
304
  },
@@ -348,16 +357,16 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
348
357
  sessionId: stringProperty('Annotated attachment session id.'),
349
358
  type: stringProperty('Marker type.'),
350
359
  kind: stringProperty('Alias for type. Marker kind: pin, box, arrow, or text-note.'),
351
- x: numberProperty('Normalized x coordinate in the 0..1 range.'),
352
- y: numberProperty('Normalized y coordinate in the 0..1 range.'),
353
- width: numberProperty('Optional normalized width in the 0..1 range.'),
354
- height: numberProperty('Optional normalized height in the 0..1 range.'),
360
+ x: boundedNumberProperty('Normalized x coordinate in the 0..1 range.', 0, 1),
361
+ y: boundedNumberProperty('Normalized y coordinate in the 0..1 range.', 0, 1),
362
+ width: boundedNumberProperty('Optional normalized width in the 0..1 range.', 0, 1),
363
+ height: boundedNumberProperty('Optional normalized height in the 0..1 range.', 0, 1),
355
364
  text: stringProperty('Optional marker text or note.'),
356
365
  instruction: stringProperty('Alias for text. Marker instruction or note.'),
357
366
  instructionType: stringProperty('Optional marker instruction category.'),
358
367
  color: stringProperty('Optional marker color.'),
359
- x2: numberProperty('Arrow endpoint normalized x coordinate.'),
360
- y2: numberProperty('Arrow endpoint normalized y coordinate.'),
368
+ x2: boundedNumberProperty('Arrow endpoint normalized x coordinate.', 0, 1),
369
+ y2: boundedNumberProperty('Arrow endpoint normalized y coordinate.', 0, 1),
361
370
  },
362
371
  required: ['sessionId'],
363
372
  },
@@ -378,12 +387,12 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
378
387
  properties: {
379
388
  sessionId: stringProperty('Annotated attachment session id.'),
380
389
  markerId: stringProperty('Marker id within the session.'),
381
- x: numberProperty('Updated normalized x coordinate.'),
382
- y: numberProperty('Updated normalized y coordinate.'),
383
- width: numberProperty('Updated normalized width.'),
384
- height: numberProperty('Updated normalized height.'),
385
- x2: numberProperty('Updated arrow endpoint normalized x coordinate.'),
386
- y2: numberProperty('Updated arrow endpoint normalized y coordinate.'),
390
+ x: boundedNumberProperty('Updated normalized x coordinate.', 0, 1),
391
+ y: boundedNumberProperty('Updated normalized y coordinate.', 0, 1),
392
+ width: boundedNumberProperty('Updated normalized width.', 0, 1),
393
+ height: boundedNumberProperty('Updated normalized height.', 0, 1),
394
+ x2: boundedNumberProperty('Updated arrow endpoint normalized x coordinate.', 0, 1),
395
+ y2: boundedNumberProperty('Updated arrow endpoint normalized y coordinate.', 0, 1),
387
396
  instruction: stringProperty('Updated marker instruction.'),
388
397
  instructionType: stringProperty('Updated marker instruction category.'),
389
398
  color: stringProperty('Updated marker color.'),
@@ -397,7 +406,7 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
397
406
  properties: {
398
407
  sessionId: stringProperty('Annotated attachment session id.'),
399
408
  markerId: stringProperty('Marker id within the session.'),
400
- toIndex: numberProperty('Target zero-based review order.'),
409
+ toIndex: integerProperty('Target zero-based review order.', 0),
401
410
  },
402
411
  required: ['sessionId', 'markerId', 'toIndex'],
403
412
  },
@@ -541,9 +550,9 @@ export function registerDocumentAssetTools(registerTool, executeTool) {
541
550
  uploadedPath: stringProperty('Finalize a previously staged remote upload by passing the uploaded Taskforce storage path returned by save_task_attachment init mode.'),
542
551
  uploadDraftId: stringProperty('Finalize a previously staged remote upload by passing the uploadDraftId returned by save_task_attachment init mode.'),
543
552
  mimeType: stringProperty('Mime type for staged remote uploads such as image/png or image/jpeg. Provide this with sizeBytes to start a staged upload.'),
544
- sizeBytes: numberProperty('File size in bytes for staged remote uploads. Provide this with mimeType to start a staged upload.'),
553
+ sizeBytes: integerProperty('File size in bytes for staged remote uploads. Provide this with mimeType to start a staged upload.', 0),
545
554
  }),
546
- expectedSizeBytes: numberProperty('Optional exact byte count for integrity verification. The save is rejected before attachment when the persisted bytes would differ.'),
555
+ expectedSizeBytes: integerProperty('Optional exact byte count for integrity verification. The save is rejected before attachment when the persisted bytes would differ.', 0),
547
556
  expectedSha256: stringProperty('Optional lowercase or uppercase SHA-256 hex digest for integrity verification. The save is rejected before attachment when the persisted bytes would differ.'),
548
557
  displayName: stringProperty('Optional attachment display name. Defaults to filename and is independent from caption.'),
549
558
  caption: stringProperty('Optional attachment caption.'),
@@ -43,6 +43,7 @@ export declare function createDocumentHelpers(deps: DocumentHelpersDeps): {
43
43
  } | null;
44
44
  searchDocumentAssets: (queryRaw: unknown, options?: {
45
45
  limit?: unknown;
46
+ offset?: unknown;
46
47
  }) => Array<{
47
48
  asset: WorkspaceDocumentEntry;
48
49
  matchedOn: string[];
@@ -51,8 +51,10 @@ export function createDocumentHelpers(deps) {
51
51
  }
52
52
  const requestedLimit = Number(options?.limit);
53
53
  const limit = Number.isFinite(requestedLimit)
54
- ? Math.max(1, Math.min(50, Math.trunc(requestedLimit)))
54
+ ? Math.max(1, Math.min(51, Math.trunc(requestedLimit)))
55
55
  : 10;
56
+ const requestedOffset = Number(options?.offset);
57
+ const offset = Number.isFinite(requestedOffset) ? Math.max(0, Math.trunc(requestedOffset)) : 0;
56
58
  const normalize = (value) => typeof value === 'string' ? value.trim().toLowerCase() : '';
57
59
  const tokenize = (value) => normalize(value).split(/[^a-z0-9]+/i).filter(Boolean);
58
60
  const allDocuments = deps.workspaceAssetStore.listDocumentsByWorkspace(deps.activeWorkspaceId);
@@ -103,8 +105,10 @@ export function createDocumentHelpers(deps) {
103
105
  return [{ asset, matchedOn: Array.from(matchedOn), score }];
104
106
  });
105
107
  return scoredMatches
106
- .sort((a, b) => b.score - a.score || String(b.asset.updatedAt || '').localeCompare(String(a.asset.updatedAt || '')))
107
- .slice(0, limit);
108
+ .sort((a, b) => b.score - a.score
109
+ || String(b.asset.updatedAt || '').localeCompare(String(a.asset.updatedAt || ''))
110
+ || a.asset.assetId.localeCompare(b.asset.assetId))
111
+ .slice(offset, offset + limit);
108
112
  };
109
113
  const resolveDocumentAssetByIdentifierOrThrow = (documentIdentifier, options) => {
110
114
  const normalizedValue = typeof documentIdentifier === 'string' ? documentIdentifier.trim() : '';