@taskforcehq/taskforce 0.3.327 → 0.3.328

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 (187) hide show
  1. package/dist/Taskforce.module.css +24 -53
  2. package/dist/components/activity/EntityActivityTimeline.js +15 -5
  3. package/dist/components/context/AttachmentPreviewHost.js +1 -1
  4. package/dist/components/context/ContextAttachmentManager.d.ts +3 -0
  5. package/dist/components/context/ContextAttachmentManager.js +116 -20
  6. package/dist/components/features/planning/PlanningEntitySummary.d.ts +3 -1
  7. package/dist/components/features/planning/PlanningEntitySummary.js +3 -2
  8. package/dist/components/features/planning/PlanningLinkPicker.d.ts +3 -1
  9. package/dist/components/features/planning/PlanningLinkPicker.js +5 -3
  10. package/dist/components/features/planning/PlanningModule.js +26 -9
  11. package/dist/components/features/planning/PlanningVisualIdentity.d.ts +14 -0
  12. package/dist/components/features/planning/PlanningVisualIdentity.js +106 -0
  13. package/dist/components/features/planning/planningWorkspaceModel.d.ts +11 -0
  14. package/dist/components/task/TaskActionHeader.d.ts +2 -1
  15. package/dist/components/task/TaskActionHeader.js +2 -2
  16. package/dist/components/task/TaskCard.js +37 -4
  17. package/dist/components/task/TaskContextUpload.d.ts +3 -0
  18. package/dist/components/task/TaskContextUpload.js +2 -2
  19. package/dist/components/task/TaskForm.d.ts +4 -0
  20. package/dist/components/task/TaskForm.js +32 -7
  21. package/dist/components/task/TaskImageReviews.js +16 -16
  22. package/dist/components/task/TaskStatusActions.js +11 -2
  23. package/dist/components/task/TaskWorkstreamPicker.js +2 -1
  24. package/dist/components/ui/DocumentTypeIcon.d.ts +7 -0
  25. package/dist/components/ui/DocumentTypeIcon.js +8 -0
  26. package/dist/components/ui/TaxonomyDropdown.d.ts +9 -1
  27. package/dist/components/ui/TaxonomyDropdown.js +30 -3
  28. package/dist/components/views/StandaloneLayout.js +62 -9
  29. package/dist/components/views/WidgetView.js +8 -5
  30. package/dist/components/views/panels/PlanningDrawer.d.ts +7 -1
  31. package/dist/components/views/panels/PlanningDrawer.js +48 -44
  32. package/dist/config/envSchema.js +1 -0
  33. package/dist/config/localServiceCloudTarget.d.ts +10 -0
  34. package/dist/config/localServiceCloudTarget.js +76 -0
  35. package/dist/core/AiProfileService.d.ts +1 -0
  36. package/dist/core/AiProfileService.js +2 -1
  37. package/dist/core/AttachmentLinkService.js +7 -4
  38. package/dist/core/DeletedTaskLifecycleService.d.ts +4 -0
  39. package/dist/core/DeletedTaskLifecycleService.js +21 -0
  40. package/dist/core/McpTokenService.d.ts +4 -0
  41. package/dist/core/McpTokenService.js +52 -0
  42. package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +5 -0
  43. package/dist/core/TaskAttachmentLinksDurableMutationService.js +20 -11
  44. package/dist/core/Taskforce.d.ts +63 -1
  45. package/dist/core/Taskforce.js +558 -73
  46. package/dist/core/types.d.ts +2 -1
  47. package/dist/documentReviews/DocumentReviewCommentStore.d.ts +11 -0
  48. package/dist/documentReviews/DocumentReviewCommentStore.js +35 -2
  49. package/dist/documentReviews/service.d.ts +4 -0
  50. package/dist/documentReviews/service.js +141 -46
  51. package/dist/hooks/tasks/useTaskFormActions.d.ts +3 -0
  52. package/dist/hooks/tasks/useTaskFormActions.js +33 -7
  53. package/dist/hooks/useTaskforce.d.ts +59 -50
  54. package/dist/hooks/useTaskforce.js +103 -1
  55. package/dist/mcp/canonicalAssetHelpers.d.ts +13 -0
  56. package/dist/mcp/canonicalAssetHelpers.js +39 -5
  57. package/dist/mcp/collaborationRegistrar.js +15 -13
  58. package/dist/mcp/documentAssetRegistrar.js +16 -9
  59. package/dist/mcp/localServiceProxy.js +4 -1
  60. package/dist/mcp/runtime.d.ts +16 -0
  61. package/dist/mcp/runtime.js +566 -171
  62. package/dist/mcp/taskAttachmentCommandAdapter.d.ts +2 -0
  63. package/dist/mcp/taskAttachmentCommandAdapter.js +14 -8
  64. package/dist/mcp/taskPlanningRegistrar.js +42 -34
  65. package/dist/mcp/toolRegistry.js +2 -2
  66. package/dist/migrations/taskSchemaMigrations.js +35 -0
  67. package/dist/runtime/appGateDefinitions.d.ts +2 -2
  68. package/dist/runtime/appGateDefinitions.js +2 -2
  69. package/dist/server/appAccess.d.ts +12 -0
  70. package/dist/server/appAccess.js +21 -0
  71. package/dist/server/authorizedWorkspaceAccess.d.ts +12 -0
  72. package/dist/server/authorizedWorkspaceAccess.js +40 -0
  73. package/dist/server/cloudCollectionRead.d.ts +25 -0
  74. package/dist/server/cloudCollectionRead.js +120 -0
  75. package/dist/server/cloudCollectionReadPool.d.ts +52 -0
  76. package/dist/server/cloudCollectionReadPool.js +140 -0
  77. package/dist/server/cloudCollectionReadWorker.d.ts +1 -0
  78. package/dist/server/cloudCollectionReadWorker.js +36 -0
  79. package/dist/server/index.d.ts +3 -11
  80. package/dist/server/index.js +53 -40
  81. package/dist/server/localServiceLease.d.ts +3 -0
  82. package/dist/server/localServiceLease.js +9 -1
  83. package/dist/server/routes/documents.d.ts +5 -2
  84. package/dist/server/routes/documents.js +160 -13
  85. package/dist/server/routes/durableTaskHttpRouters.d.ts +2 -0
  86. package/dist/server/routes/durableTaskHttpRouters.js +2 -2
  87. package/dist/server/routes/localService.js +2 -0
  88. package/dist/server/routes/primitives.d.ts +2 -0
  89. package/dist/server/routes/shared.d.ts +24 -0
  90. package/dist/server/routes/shared.js +114 -18
  91. package/dist/server/routes/sync.js +22 -0
  92. package/dist/server/routes/syncV3FeedRoutes.js +4 -2
  93. package/dist/server/routes/syncV3LocalCaptureRoutes.js +20 -2
  94. package/dist/server/routes/syncV3OperationRoutes.js +17 -2
  95. package/dist/server/routes/tasks.js +199 -89
  96. package/dist/server/routes.js +35 -7
  97. package/dist/service/localServiceCli.js +36 -25
  98. package/dist/service/localServiceClientLifecycle.js +67 -6
  99. package/dist/shared/planningIdentity.d.ts +20 -0
  100. package/dist/shared/planningIdentity.js +79 -0
  101. package/dist/storage/postgresAdapter.js +4 -0
  102. package/dist/storage/postgresRequestDiagnostics.d.ts +8 -0
  103. package/dist/storage/postgresRequestDiagnostics.js +24 -0
  104. package/dist/storage/workspaceAssetStore.d.ts +32 -0
  105. package/dist/storage/workspaceAssetStore.js +70 -0
  106. package/dist/sync/coordinator/localSyncExecutionPermitStore.d.ts +16 -0
  107. package/dist/sync/coordinator/localSyncExecutionPermitStore.js +70 -22
  108. package/dist/sync/coordinator/workspaceSyncTransportGateway.js +4 -2
  109. package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +5 -0
  110. package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.d.ts +1 -1
  111. package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +15 -0
  112. package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +26 -3
  113. package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +2 -0
  114. package/dist/sync/syncApplyHandlers.d.ts +3 -1
  115. package/dist/sync/syncApplyHandlers.js +29 -0
  116. package/dist/sync/syncService.js +9 -0
  117. package/dist/sync/taskSyncPayload.d.ts +1 -0
  118. package/dist/sync/taskSyncPayload.js +6 -0
  119. package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +1 -0
  120. package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +21 -3
  121. package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +17 -4
  122. package/dist/sync/v3/localInitiativeOutboxService.js +4 -2
  123. package/dist/sync/v3/localOutboxDispatcher.js +5 -1
  124. package/dist/sync/v3/localTaskAttachmentLinksOutboxHandler.js +12 -2
  125. package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +1 -0
  126. package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +15 -3
  127. package/dist/sync/v3/localWorkstreamOutboxService.js +4 -2
  128. package/dist/sync/v3/syncDurabilityStore.d.ts +8 -0
  129. package/dist/sync/v3/syncDurabilityStore.js +171 -33
  130. package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +1 -0
  131. package/dist/sync/v3/taskAttachmentLinksMutationService.js +18 -2
  132. package/dist/sync/v3/taskMetadataCoexistence.js +4 -0
  133. package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +1 -9
  134. package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +1 -0
  135. package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +7 -1
  136. package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +15 -3
  137. package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +4 -0
  138. package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +29 -6
  139. package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +1 -0
  140. package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +29 -7
  141. package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +62 -7
  142. package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +1 -0
  143. package/dist/sync/v3/workspaceSyncV3RepairSqlBatching.d.ts +2 -0
  144. package/dist/sync/v3/workspaceSyncV3RepairSqlBatching.js +10 -0
  145. package/dist/sync/v3/workspaceSyncV3TaskRootProjection.d.ts +1 -1
  146. package/dist/sync/v3/workspaceSyncV3TaskRootProjection.js +1 -1
  147. package/dist/sync/workspacePullFeed.d.ts +6 -1
  148. package/dist/sync/workspacePullFeed.js +172 -161
  149. package/dist/sync/workspaceSyncModel.d.ts +11 -0
  150. package/dist/sync/workspaceSyncModel.js +27 -2
  151. package/dist/types.d.ts +8 -0
  152. package/dist/ui/assets/{AiIdentityRosterCard-DB1BLO_j.js → AiIdentityRosterCard-MZs7lVED.js} +1 -1
  153. package/dist/ui/assets/{AiProfilesModule-DPxQeF9N.js → AiProfilesModule-C3i0LOxe.js} +1 -1
  154. package/dist/ui/assets/{AnnotatedAttachmentWorkspace-DHNYaNg6.js → AnnotatedAttachmentWorkspace-DVZk5Tln.js} +1 -1
  155. package/dist/ui/assets/AssetTraySortControl-Kf1pelSy.js +1 -0
  156. package/dist/ui/assets/ContextAttachmentManager-B8boOs6Q.js +3 -0
  157. package/dist/ui/assets/{DocumentWorkspace-BC7sy5TG.js → DocumentWorkspace-DXH4XUsB.js} +4 -4
  158. package/dist/ui/assets/EntityActivityTimeline-BtSTq0ON.js +1 -0
  159. package/dist/ui/assets/PlanningModule-BPVyEa-f.js +1 -0
  160. package/dist/ui/assets/PlanningModule-CoIR9hbV.css +1 -0
  161. package/dist/ui/assets/{PlansPage-BVH_NfgT.js → PlansPage-ChqgxALc.js} +1 -1
  162. package/dist/ui/assets/TaskContextUpload-CB3ol0sN.js +1 -0
  163. package/dist/ui/assets/TaskContextUpload-qmBeUw3u.css +1 -0
  164. package/dist/ui/assets/{TaskSettings-xVsxSa0g.js → TaskSettings-g4ECKNOz.js} +1 -1
  165. package/dist/ui/assets/{TaskforceAgentsModule-CkAxW19K.js → TaskforceAgentsModule-BazdUwxZ.js} +1 -1
  166. package/dist/ui/assets/WorkflowManagerModule-DWFspC-o.js +1 -0
  167. package/dist/ui/assets/index-BUplSsv_.js +7 -0
  168. package/dist/ui/assets/index-gz2EXuoK.css +1 -0
  169. package/dist/ui/assets/{vendor-icons-B8ZNsH1g.js → vendor-icons-BkFLXavV.js} +1 -1
  170. package/dist/ui/index.html +3 -3
  171. package/dist/utils/constants.d.ts +2 -2
  172. package/dist/utils/constants.js +1 -1
  173. package/dist/utils/contextAttachmentUpload.d.ts +2 -0
  174. package/dist/utils/contextAttachmentUpload.js +7 -0
  175. package/dist/utils/contextFiles.d.ts +1 -1
  176. package/dist/utils/contextFiles.js +4 -4
  177. package/package.json +6 -1
  178. package/dist/ui/assets/AssetTraySortControl-DphbyHVc.js +0 -1
  179. package/dist/ui/assets/ContextAttachmentManager-CMxSzHqc.js +0 -3
  180. package/dist/ui/assets/EntityActivityTimeline-pJ2ZjZ-k.js +0 -1
  181. package/dist/ui/assets/PlanningModule-CeTqXMMz.css +0 -1
  182. package/dist/ui/assets/PlanningModule-t5GbvVR9.js +0 -1
  183. package/dist/ui/assets/TaskContextUpload-Ds4LnDzV.css +0 -1
  184. package/dist/ui/assets/TaskContextUpload-bl4fOOUz.js +0 -1
  185. package/dist/ui/assets/WorkflowManagerModule-BKqIGVnF.js +0 -1
  186. package/dist/ui/assets/index-BzJlVnNS.css +0 -1
  187. package/dist/ui/assets/index-Cx7vZJHL.js +0 -7
@@ -973,6 +973,58 @@ export class McpTokenService {
973
973
  `).run(profileId, profileToken, profileName, now, this.tenantId, workspaceId, grantId);
974
974
  return Number(result?.changes || 0) > 0;
975
975
  }
976
+ listMcpOAuthRestorableAiProfileIds(input) {
977
+ const grantId = String(input.grantId || '').trim();
978
+ const workspaceId = String(input.workspaceId || '').trim();
979
+ if (!grantId || !workspaceId)
980
+ return [];
981
+ const current = this.db.prepare(`
982
+ SELECT current.provider, current.user_id, current_client.client_name,
983
+ current_client.redirect_uris_json, current_client.product_client_id
984
+ FROM mcp_oauth_connector_grants current
985
+ JOIN mcp_oauth_clients current_client
986
+ ON current_client.tenant_id = current.tenant_id
987
+ AND current_client.id = current.client_id
988
+ WHERE current.tenant_id = ?
989
+ AND current.workspace_id = ?
990
+ AND current.id = ?
991
+ AND current.status = 'active'
992
+ LIMIT 1
993
+ `).get(this.tenantId, workspaceId, grantId);
994
+ if (!current?.provider || !current.user_id)
995
+ return [];
996
+ const canonicalRedirectUris = (value) => {
997
+ try {
998
+ const parsed = JSON.parse(String(value || '[]'));
999
+ if (!Array.isArray(parsed))
1000
+ return null;
1001
+ return JSON.stringify([...new Set(parsed.map((uri) => String(uri || '').trim()).filter(Boolean))].sort());
1002
+ }
1003
+ catch {
1004
+ return null;
1005
+ }
1006
+ };
1007
+ const currentRedirectUris = canonicalRedirectUris(current.redirect_uris_json);
1008
+ if (!currentRedirectUris)
1009
+ return [];
1010
+ const previousRows = this.db.prepare(`
1011
+ SELECT previous.ai_profile_id, previous_client.client_name,
1012
+ previous_client.redirect_uris_json, previous_client.product_client_id
1013
+ FROM mcp_oauth_connector_grants previous
1014
+ JOIN mcp_oauth_clients previous_client
1015
+ ON previous_client.tenant_id = previous.tenant_id
1016
+ AND previous_client.id = previous.client_id
1017
+ WHERE previous.tenant_id = ?
1018
+ AND previous.workspace_id = ?
1019
+ AND previous.user_id = ?
1020
+ AND previous.provider = ?
1021
+ AND previous.id <> ?
1022
+ AND previous.ai_profile_id IS NOT NULL
1023
+ `).all(this.tenantId, workspaceId, String(current.user_id), String(current.provider), grantId);
1024
+ return [...new Set(previousRows.filter((row) => (String(row.client_name || '') === String(current.client_name || '')
1025
+ && String(row.product_client_id || '') === String(current.product_client_id || '')
1026
+ && canonicalRedirectUris(row.redirect_uris_json) === currentRedirectUris)).map((row) => String(row.ai_profile_id || '').trim()).filter(Boolean))].sort();
1027
+ }
976
1028
  recordMcpOAuthConnectorGrantUsage(input) {
977
1029
  const grantId = String(input.grantId || '').trim();
978
1030
  const workspaceId = String(input.workspaceId || '').trim();
@@ -18,6 +18,11 @@ export interface DurableTaskAttachmentLinksCore {
18
18
  export interface DurableWorkspaceTaskAttachmentLinksCore extends DurableTaskAttachmentLinksCore {
19
19
  getWorkspaceAssetStore(): Pick<WorkspaceAssetStore, 'get' | 'listLinksForTask' | 'listLinksForWorkspace' | 'listAllNormalizedByWorkspace' | 'adoptReadableReferenceNumber'>;
20
20
  }
21
+ export declare function resolveTaskCardCoverAssetIdForLinks(input: {
22
+ currentCardCoverAssetId?: string | null;
23
+ requestedCardCoverAssetId?: string | null;
24
+ links: readonly WorkspaceSyncV3TaskAttachmentLink[];
25
+ }): string | null;
21
26
  export declare function listTaskAttachmentLinksForDurableSync(core: DurableTaskAttachmentLinksCore, workspaceId: string, taskId: string): WorkspaceSyncV3TaskAttachmentLink[];
22
27
  export declare function listWorkspaceTaskAttachmentLinksForDurableSync(core: DurableWorkspaceTaskAttachmentLinksCore, workspaceId: string, taskIds: ReadonlySet<string>): Map<string, WorkspaceSyncV3TaskAttachmentLink[]>;
23
28
  export declare function resolveTaskAttachmentLinksForDurableSync(core: DurableTaskAttachmentLinksCore, workspaceId: string, links: readonly WorkspaceSyncV3TaskAttachmentLink[], options?: {
@@ -12,6 +12,19 @@ export class DurableTaskAttachmentLinksApplyError extends Error {
12
12
  this.name = 'DurableTaskAttachmentLinksApplyError';
13
13
  }
14
14
  }
15
+ export function resolveTaskCardCoverAssetIdForLinks(input) {
16
+ const explicitlyRequested = Object.prototype.hasOwnProperty.call(input, 'requestedCardCoverAssetId');
17
+ const candidate = explicitlyRequested
18
+ ? String(input.requestedCardCoverAssetId || '').trim()
19
+ : String(input.currentCardCoverAssetId || '').trim();
20
+ if (!candidate)
21
+ return null;
22
+ const matchingImage = input.links.some((link) => link.assetId === candidate && link.role === 'image');
23
+ if (!matchingImage && explicitlyRequested) {
24
+ throw new DurableTaskAttachmentLinksApplyError('Task card cover must reference an image already attached to this task.', 'TASK_ATTACHMENT_LINK_INVALID', 400, candidate);
25
+ }
26
+ return matchingImage ? candidate : null;
27
+ }
15
28
  function fail(message, code, statusCode, assetId) {
16
29
  throw new DurableTaskAttachmentLinksApplyError(message, code, statusCode, assetId);
17
30
  }
@@ -159,13 +172,11 @@ export function resolveTaskAttachmentLinksForDurableSync(core, workspaceId, link
159
172
  fail('Task attachment links must have unique asset and role identities.', 'TASK_ATTACHMENT_LINK_INVALID', 400);
160
173
  }
161
174
  identities.add(identity);
162
- const displayName = asset.kind === 'document' && asset.storageProvider !== 'external'
163
- ? null
164
- : String(link.displayName
165
- || (options?.ignoreAssetMetadataSnapshots === true ? '' : link.caption)
166
- || (options?.ignoreAssetMetadataSnapshots === true ? '' : link.originalFilename)
167
- || asset.logicalName
168
- || asset.originalFilename).trim() || null;
175
+ const displayName = String(link.displayName
176
+ || (options?.ignoreAssetMetadataSnapshots === true ? '' : link.originalFilename)
177
+ || (options?.ignoreAssetMetadataSnapshots === true ? '' : link.caption)
178
+ || asset.originalFilename
179
+ || asset.logicalName).trim() || null;
169
180
  const projected = canonicalLink(asset, { role, displayName, sortOrder: index }, index);
170
181
  if (options?.ignoreAssetMetadataSnapshots !== true
171
182
  && ((link.referenceNumber ?? null) !== (projected.referenceNumber ?? null)
@@ -205,10 +216,8 @@ export function normalizeTaskAttachmentDescriptorsForDurableSync(core, workspace
205
216
  fail('Task attachment links must have unique asset and role identities.', 'TASK_ATTACHMENT_LINK_INVALID', 400);
206
217
  }
207
218
  identities.add(identity);
208
- const displayName = asset.kind === 'document' && asset.storageProvider !== 'external'
209
- ? null
210
- : String(attachment.caption || attachment.displayName || attachment.originalFilename
211
- || asset.logicalName || asset.originalFilename).trim() || null;
219
+ const displayName = String(attachment.displayName || attachment.originalFilename || attachment.caption
220
+ || asset.logicalName || asset.originalFilename).trim() || null;
212
221
  return canonicalLink(asset, { role, displayName, sortOrder: order }, order);
213
222
  });
214
223
  }
@@ -1,3 +1,4 @@
1
+ import { type PlanningIdentityColor, type PlanningIdentityEntityType, type PlanningIdentityIcon } from '../shared/planningIdentity.js';
1
2
  import type { DatabaseAdapter, DatabaseProvider } from '../storage/databaseAdapter.js';
2
3
  import { type LocalDataOwnerPermit } from '../server/localDataOwnerPermit.js';
3
4
  import type { DurableTaskStatusMutationPayload } from './TaskDurableStatusMutationService.js';
@@ -151,6 +152,7 @@ export interface TaskItem {
151
152
  activity?: TaskActivityItem[];
152
153
  taskEvents?: TaskEvent[];
153
154
  attachments?: AttachmentItem[];
155
+ cardCoverAssetId?: string | null;
154
156
  /** @deprecated Use status='done'. Safe to remove after v0.4.x migration gate. */
155
157
  completed?: boolean;
156
158
  /** @deprecated Use status='cancelled'. Safe to remove after v0.4.x migration gate. */
@@ -190,6 +192,9 @@ export interface InitiativeItem {
190
192
  title: string;
191
193
  description: string | null;
192
194
  ownerId?: string | null;
195
+ icon?: PlanningIdentityIcon | null;
196
+ color?: PlanningIdentityColor | null;
197
+ identityUpdatedAt?: string | null;
193
198
  comments?: Comment[];
194
199
  activity?: EntityActivityItem[];
195
200
  entityEvents?: PlanningEntityEvent[];
@@ -207,6 +212,9 @@ export interface WorkstreamItem {
207
212
  title: string;
208
213
  description: string | null;
209
214
  ownerId?: string | null;
215
+ icon?: PlanningIdentityIcon | null;
216
+ color?: PlanningIdentityColor | null;
217
+ identityUpdatedAt?: string | null;
210
218
  comments?: Comment[];
211
219
  activity?: EntityActivityItem[];
212
220
  entityEvents?: PlanningEntityEvent[];
@@ -216,6 +224,13 @@ export interface WorkstreamItem {
216
224
  order?: number | null;
217
225
  isArchived?: boolean;
218
226
  }
227
+ export interface PlanningEntityIdentityRecord {
228
+ entityType: PlanningIdentityEntityType;
229
+ entityId: string;
230
+ icon: PlanningIdentityIcon | null;
231
+ color: PlanningIdentityColor | null;
232
+ updatedAt: string;
233
+ }
219
234
  export interface ChecklistItem {
220
235
  id: string;
221
236
  taskId: string;
@@ -254,7 +269,7 @@ export interface ScheduleBoardResult {
254
269
  }>;
255
270
  };
256
271
  }
257
- export type RealtimeMutationEntityType = 'task' | 'taxonomy' | 'document-metadata';
272
+ export type RealtimeMutationEntityType = 'task' | 'initiative' | 'workstream' | 'taxonomy' | 'document-metadata';
258
273
  export interface RealtimeMutationEvent {
259
274
  eventId: string;
260
275
  workspaceId: string;
@@ -299,6 +314,7 @@ export interface TaskforceConfig {
299
314
  storagePath?: string;
300
315
  tenantId?: string;
301
316
  runtimeMode?: RuntimeMode;
317
+ initializationMode?: 'standard' | 'cloud-read-worker';
302
318
  localDataOwnerPermit?: LocalDataOwnerPermit;
303
319
  database?: {
304
320
  provider?: DatabaseProvider;
@@ -856,6 +872,8 @@ export interface TaskforceSyncCapable {
856
872
  listInitiativesForSync(workspaceId: string | undefined, afterId: string | null, limit: number): InitiativeItem[];
857
873
  listWorkstreams(workspaceId?: string): WorkstreamItem[];
858
874
  listWorkstreamsForSync(workspaceId: string | undefined, afterId: string | null, limit: number): WorkstreamItem[];
875
+ listPlanningEntityIdentities(workspaceId?: string): PlanningEntityIdentityRecord[];
876
+ applyPlanningEntityIdentityForSync(identity: PlanningEntityIdentityRecord, workspaceId?: string | null): PlanningEntityIdentityRecord | null;
859
877
  listAiProfiles(workspaceId: string, options?: {
860
878
  includeArchived?: boolean;
861
879
  }): AiProfileRecord[];
@@ -976,6 +994,7 @@ export interface TaskforceSyncCapable {
976
994
  workspaceId: string;
977
995
  connectionId: string;
978
996
  seatScope?: AiProfileSeatScope | null;
997
+ repairLegacyBinding?: boolean;
979
998
  }): AiProfileRecord | null;
980
999
  resolveWorkspaceActor(workspaceId: string, actorRef: unknown): TaskActor | null;
981
1000
  }
@@ -1316,6 +1335,13 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1316
1335
  getWorkstream(id: string, workspaceId?: string): WorkstreamItem | null;
1317
1336
  listWorkstreams(workspaceId?: string): WorkstreamItem[];
1318
1337
  listWorkstreamsForSync(workspaceId: string | undefined, afterId: string | null, limit: number): WorkstreamItem[];
1338
+ listPlanningEntityIdentities(workspaceId?: string): PlanningEntityIdentityRecord[];
1339
+ private writePlanningEntityIdentity;
1340
+ updatePlanningEntityIdentity(entityType: PlanningIdentityEntityType, entityId: string, patch: {
1341
+ icon?: unknown;
1342
+ color?: unknown;
1343
+ }, workspaceId?: string): InitiativeItem | WorkstreamItem;
1344
+ applyPlanningEntityIdentityForSync(identity: PlanningEntityIdentityRecord, workspaceId?: string | null): PlanningEntityIdentityRecord | null;
1319
1345
  listPlanningBootstrap(workspaceId?: string, diagnostics?: PlanningBootstrapDiagnostics): PlanningBootstrapPayload;
1320
1346
  createWorkstream(input: Partial<WorkstreamItem>, workspaceId?: string, options?: {
1321
1347
  actorRef?: string;
@@ -1438,7 +1464,23 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1438
1464
  limit?: number;
1439
1465
  offset?: number;
1440
1466
  workstreamId?: string;
1467
+ includeArchived?: boolean;
1441
1468
  }): Array<Record<string, unknown>>;
1469
+ listTaskCountsByWorkstream(workspaceId?: string, workstreamId?: string): Array<{
1470
+ workstreamId: string;
1471
+ total: number;
1472
+ active: number;
1473
+ archived: number;
1474
+ }>;
1475
+ listTaskReferenceSummaries(taskIds: string[], workspaceId?: string): Array<{
1476
+ id: string;
1477
+ referenceNumber: number | null;
1478
+ localReferenceNumber: number | null;
1479
+ referenceLabel: string | null;
1480
+ title: string;
1481
+ status: TaskStatus;
1482
+ }>;
1483
+ searchTaskSummaries(query: string, scope?: 'all' | 'active' | 'archive', workspaceId?: string): Array<Record<string, unknown>>;
1442
1484
  getDataVersion(): number;
1443
1485
  getDatabaseProvider(): DatabaseProvider;
1444
1486
  isDatabaseHealthy(): boolean;
@@ -1446,6 +1488,9 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1446
1488
  listDeletedTasks(workspaceId?: string): {
1447
1489
  deleted: DeletedTaskRecord[];
1448
1490
  };
1491
+ listDeletedTasksReadOnly(workspaceId?: string): {
1492
+ deleted: DeletedTaskRecord[];
1493
+ };
1449
1494
  getDeletedTask(id: string, workspaceId?: string): DeletedTaskRecord | null;
1450
1495
  private assertNoDurableTaskDeleteOwnership;
1451
1496
  permanentlyDeleteDeletedTask(id: string, workspaceId?: string): boolean;
@@ -1465,6 +1510,7 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1465
1510
  total: number;
1466
1511
  doneCount: number;
1467
1512
  cancelledCount: number;
1513
+ otherCount: number;
1468
1514
  retentionDays: number;
1469
1515
  };
1470
1516
  };
@@ -1602,6 +1648,7 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1602
1648
  workspaceId: string;
1603
1649
  connectionId: string;
1604
1650
  seatScope?: AiProfileSeatScope | null;
1651
+ repairLegacyBinding?: boolean;
1605
1652
  }): AiProfileRecord | null;
1606
1653
  resolveAiProfile(input: ResolveAiProfileInput, options?: ResolveAiProfileOptions): ResolveAiProfileResult;
1607
1654
  listAnnotatedAttachmentSessions(input: {
@@ -1717,6 +1764,8 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1717
1764
  body: string;
1718
1765
  anchor?: DocumentReviewAnchor | null;
1719
1766
  actorId?: string | null;
1767
+ idempotencyKey?: string | null;
1768
+ commentId?: string | null;
1720
1769
  }): DocumentReviewSession;
1721
1770
  addDocumentReviewReply(input: {
1722
1771
  workspaceId?: string | null;
@@ -1724,6 +1773,8 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
1724
1773
  parentCommentId: string;
1725
1774
  body: string;
1726
1775
  actorId?: string | null;
1776
+ idempotencyKey?: string | null;
1777
+ commentId?: string | null;
1727
1778
  }): DocumentReviewSession;
1728
1779
  updateDocumentReviewThreadStatus(input: {
1729
1780
  workspaceId?: string | null;
@@ -2150,6 +2201,10 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
2150
2201
  profileToken: string;
2151
2202
  profileName: string;
2152
2203
  }): boolean;
2204
+ listMcpOAuthRestorableAiProfileIds(input: {
2205
+ grantId: string;
2206
+ workspaceId: string;
2207
+ }): string[];
2153
2208
  recordMcpOAuthConnectorGrantUsage(input: {
2154
2209
  grantId: string;
2155
2210
  workspaceId: string;
@@ -2467,6 +2522,13 @@ export declare class TaskforceCore implements TaskforceSyncCapable {
2467
2522
  task: any;
2468
2523
  archived: boolean;
2469
2524
  }>;
2525
+ /**
2526
+ * Full task inventory for authoritative repair without the per-task UI
2527
+ * hydration performed by rowToTask. Repair serializes task roots, comments,
2528
+ * and checklist items separately; task activity, actor decoration, and
2529
+ * resolved attachment bodies are not part of that canonical inventory.
2530
+ */
2531
+ listTasksForAuthoritativeRepair(workspaceId: string): TaskItem[];
2470
2532
  listWorkspaceSyncDeletesSince(workspaceId: string | undefined, cursor: {
2471
2533
  watermark: string;
2472
2534
  id: string;