@exactjs/core 0.6.2 → 0.6.3

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 (125) hide show
  1. package/AGENTS.md +12 -14
  2. package/README.md +6 -8
  3. package/dist/client/component-contract/continuation-validation.d.ts +5 -0
  4. package/dist/client/component-contract/continuation-validation.d.ts.map +1 -1
  5. package/dist/client/component-contract/continuation-validation.js +7 -0
  6. package/dist/client/component-contract/continuation-validation.js.map +1 -1
  7. package/dist/client/component-contract/contract-validation.d.ts.map +1 -1
  8. package/dist/client/component-contract/contract-validation.js +4 -1
  9. package/dist/client/component-contract/contract-validation.js.map +1 -1
  10. package/dist/client/component-contracts.d.ts +5 -0
  11. package/dist/client/component-contracts.d.ts.map +1 -1
  12. package/dist/client/component-contracts.js.map +1 -1
  13. package/dist/client/framework/component-contract-validation.d.ts +1 -1
  14. package/dist/client/framework/component-contract-validation.d.ts.map +1 -1
  15. package/dist/client/framework/component-contract-validation.js +1 -1
  16. package/dist/client/framework/component-contract-validation.js.map +1 -1
  17. package/dist/client/framework/operation-protocol.d.ts +9 -0
  18. package/dist/client/framework/operation-protocol.d.ts.map +1 -1
  19. package/dist/client/framework/operation-protocol.js.map +1 -1
  20. package/dist/client/framework/server-task-helpers.d.ts +1 -0
  21. package/dist/client/framework/server-task-helpers.d.ts.map +1 -1
  22. package/dist/client/framework/server-task-helpers.js +1 -0
  23. package/dist/client/framework/server-task-helpers.js.map +1 -1
  24. package/dist/client/framework/task-frames.d.ts +2 -1
  25. package/dist/client/framework/task-frames.d.ts.map +1 -1
  26. package/dist/client/framework/task-frames.js +1 -0
  27. package/dist/client/framework/task-frames.js.map +1 -1
  28. package/dist/client/runtime/tasks.d.ts +1 -0
  29. package/dist/client/runtime/tasks.d.ts.map +1 -1
  30. package/dist/client/runtime/tasks.js +1 -0
  31. package/dist/client/runtime/tasks.js.map +1 -1
  32. package/dist/client/tasks/contracts.d.ts +2 -0
  33. package/dist/client/tasks/contracts.d.ts.map +1 -1
  34. package/dist/client/tasks/contracts.js.map +1 -1
  35. package/dist/client/tasks/progress-bindings.d.ts +20 -0
  36. package/dist/client/tasks/progress-bindings.d.ts.map +1 -0
  37. package/dist/client/tasks/progress-bindings.js +51 -0
  38. package/dist/client/tasks/progress-bindings.js.map +1 -0
  39. package/dist/client/tasks/progress-receiver.d.ts +24 -0
  40. package/dist/client/tasks/progress-receiver.d.ts.map +1 -0
  41. package/dist/client/tasks/progress-receiver.js +71 -0
  42. package/dist/client/tasks/progress-receiver.js.map +1 -0
  43. package/dist/component-contract/continuation-validation.d.ts +5 -0
  44. package/dist/component-contract/continuation-validation.d.ts.map +1 -1
  45. package/dist/component-contract/continuation-validation.js +7 -0
  46. package/dist/component-contract/continuation-validation.js.map +1 -1
  47. package/dist/component-contract/contract-validation.d.ts.map +1 -1
  48. package/dist/component-contract/contract-validation.js +4 -1
  49. package/dist/component-contract/contract-validation.js.map +1 -1
  50. package/dist/component-contracts.d.ts +5 -0
  51. package/dist/component-contracts.d.ts.map +1 -1
  52. package/dist/component-contracts.js.map +1 -1
  53. package/dist/framework/component-contract-validation.d.ts +1 -1
  54. package/dist/framework/component-contract-validation.d.ts.map +1 -1
  55. package/dist/framework/component-contract-validation.js +1 -1
  56. package/dist/framework/component-contract-validation.js.map +1 -1
  57. package/dist/framework/operation-protocol.d.ts +9 -0
  58. package/dist/framework/operation-protocol.d.ts.map +1 -1
  59. package/dist/framework/operation-protocol.js.map +1 -1
  60. package/dist/framework/server-task-helpers.d.ts +1 -0
  61. package/dist/framework/server-task-helpers.d.ts.map +1 -1
  62. package/dist/framework/server-task-helpers.js +1 -0
  63. package/dist/framework/server-task-helpers.js.map +1 -1
  64. package/dist/framework/task-frames.d.ts +2 -1
  65. package/dist/framework/task-frames.d.ts.map +1 -1
  66. package/dist/framework/task-frames.js +1 -0
  67. package/dist/framework/task-frames.js.map +1 -1
  68. package/dist/runtime/tasks.d.ts +1 -0
  69. package/dist/runtime/tasks.d.ts.map +1 -1
  70. package/dist/runtime/tasks.js +1 -0
  71. package/dist/runtime/tasks.js.map +1 -1
  72. package/dist/server/component-contract/continuation-validation.d.ts +5 -0
  73. package/dist/server/component-contract/continuation-validation.d.ts.map +1 -1
  74. package/dist/server/component-contract/continuation-validation.js +7 -0
  75. package/dist/server/component-contract/continuation-validation.js.map +1 -1
  76. package/dist/server/component-contract/contract-validation.d.ts.map +1 -1
  77. package/dist/server/component-contract/contract-validation.js +4 -1
  78. package/dist/server/component-contract/contract-validation.js.map +1 -1
  79. package/dist/server/component-contracts.d.ts +5 -0
  80. package/dist/server/component-contracts.d.ts.map +1 -1
  81. package/dist/server/component-contracts.js.map +1 -1
  82. package/dist/server/framework/component-contract-validation.d.ts +1 -1
  83. package/dist/server/framework/component-contract-validation.d.ts.map +1 -1
  84. package/dist/server/framework/component-contract-validation.js +1 -1
  85. package/dist/server/framework/component-contract-validation.js.map +1 -1
  86. package/dist/server/framework/operation-protocol.d.ts +9 -0
  87. package/dist/server/framework/operation-protocol.d.ts.map +1 -1
  88. package/dist/server/framework/operation-protocol.js.map +1 -1
  89. package/dist/server/framework/server-task-helpers.d.ts +1 -0
  90. package/dist/server/framework/server-task-helpers.d.ts.map +1 -1
  91. package/dist/server/framework/server-task-helpers.js +1 -0
  92. package/dist/server/framework/server-task-helpers.js.map +1 -1
  93. package/dist/server/framework/task-frames.d.ts +2 -1
  94. package/dist/server/framework/task-frames.d.ts.map +1 -1
  95. package/dist/server/framework/task-frames.js +1 -0
  96. package/dist/server/framework/task-frames.js.map +1 -1
  97. package/dist/server/runtime/tasks.d.ts +1 -0
  98. package/dist/server/runtime/tasks.d.ts.map +1 -1
  99. package/dist/server/runtime/tasks.js +1 -0
  100. package/dist/server/runtime/tasks.js.map +1 -1
  101. package/dist/server/tasks/contracts.d.ts +2 -0
  102. package/dist/server/tasks/contracts.d.ts.map +1 -1
  103. package/dist/server/tasks/contracts.js.map +1 -1
  104. package/dist/server/tasks/progress-bindings.d.ts +20 -0
  105. package/dist/server/tasks/progress-bindings.d.ts.map +1 -0
  106. package/dist/server/tasks/progress-bindings.js +51 -0
  107. package/dist/server/tasks/progress-bindings.js.map +1 -0
  108. package/dist/server/tasks/progress-receiver.d.ts +24 -0
  109. package/dist/server/tasks/progress-receiver.d.ts.map +1 -0
  110. package/dist/server/tasks/progress-receiver.js +71 -0
  111. package/dist/server/tasks/progress-receiver.js.map +1 -0
  112. package/dist/tasks/contracts.d.ts +2 -0
  113. package/dist/tasks/contracts.d.ts.map +1 -1
  114. package/dist/tasks/contracts.js.map +1 -1
  115. package/dist/tasks/progress-bindings.d.ts +20 -0
  116. package/dist/tasks/progress-bindings.d.ts.map +1 -0
  117. package/dist/tasks/progress-bindings.js +51 -0
  118. package/dist/tasks/progress-bindings.js.map +1 -0
  119. package/dist/tasks/progress-receiver.d.ts +24 -0
  120. package/dist/tasks/progress-receiver.d.ts.map +1 -0
  121. package/dist/tasks/progress-receiver.js +71 -0
  122. package/dist/tasks/progress-receiver.js.map +1 -0
  123. package/package.json +1 -1
  124. package/dist/client/component/error-boundary.js.map +0 -1
  125. package/dist/server/component/error-boundary.js.map +0 -1
@@ -10,4 +10,5 @@ export { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';
10
10
  export { activateServerComponentTaskTreeForHost } from '../tasks/server-component-task-tree.js';
11
11
  export { mutateTaskCollection, ownTaskResource, stageTaskMutation, taskAnimationFrame, taskAwait, taskFetch, taskIdleCallback, taskInterval, taskObserver, taskTimeout } from '../tasks/resources.js';
12
12
  export { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';
13
+ export { createTaskProgressReporter, registerTaskProgressReceiver } from '../tasks/progress-bindings.js';
13
14
  //# sourceMappingURL=server-task-helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-task-helpers.js","sourceRoot":"","sources":["../../../src/framework/server-task-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,uCAAuC,EACvC,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { registerComponentContinuationContexts } from '../component/context-resumption.js';\nexport { dispatchComponentContinuation } from '../component/domain.js';\nexport { activateTaskForHost } from '../tasks/activation.js';\nexport { activateComputationForHost } from '../tasks/computation-activation.js';\nexport {\n\tcreateIndexedContinuationDependency,\n\tcreateTrackedContinuationDependency\n} from '../tasks/dependency-source.js';\nexport {\n\tactivateCompiledClientLatestTaskForHost,\n\tbindCompiledClientLatestTaskForHost\n} from '../tasks/compiled-latest.js';\nexport { markComponentContinuationTask } from '../tasks/component-continuation.js';\nexport { taskMutation } from '../tasks/frame-runtime.js';\nexport { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';\nexport { activateServerComponentTaskTreeForHost } from '../tasks/server-component-task-tree.js';\nexport {\n\tmutateTaskCollection,\n\townTaskResource,\n\tstageTaskMutation,\n\ttaskAnimationFrame,\n\ttaskAwait,\n\ttaskFetch,\n\ttaskIdleCallback,\n\ttaskInterval,\n\ttaskObserver,\n\ttaskTimeout\n} from '../tasks/resources.js';\nexport { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';\n"]}
1
+ {"version":3,"file":"server-task-helpers.js","sourceRoot":"","sources":["../../../src/framework/server-task-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,uCAAuC,EACvC,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,EAC5B,MAAM,+BAA+B,CAAC","sourcesContent":["export { registerComponentContinuationContexts } from '../component/context-resumption.js';\nexport { dispatchComponentContinuation } from '../component/domain.js';\nexport { activateTaskForHost } from '../tasks/activation.js';\nexport { activateComputationForHost } from '../tasks/computation-activation.js';\nexport {\n\tcreateIndexedContinuationDependency,\n\tcreateTrackedContinuationDependency\n} from '../tasks/dependency-source.js';\nexport {\n\tactivateCompiledClientLatestTaskForHost,\n\tbindCompiledClientLatestTaskForHost\n} from '../tasks/compiled-latest.js';\nexport { markComponentContinuationTask } from '../tasks/component-continuation.js';\nexport { taskMutation } from '../tasks/frame-runtime.js';\nexport { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';\nexport { activateServerComponentTaskTreeForHost } from '../tasks/server-component-task-tree.js';\nexport {\n\tmutateTaskCollection,\n\townTaskResource,\n\tstageTaskMutation,\n\ttaskAnimationFrame,\n\ttaskAwait,\n\ttaskFetch,\n\ttaskIdleCallback,\n\ttaskInterval,\n\ttaskObserver,\n\ttaskTimeout\n} from '../tasks/resources.js';\nexport { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';\n\nexport {\n\tcreateTaskProgressReporter,\n\tregisterTaskProgressReceiver\n} from '../tasks/progress-bindings.js';\n"]}
@@ -69,5 +69,6 @@ export declare function runTaskFrame<T>(options: RunTaskFrameOptions, hooks: Run
69
69
  export declare function reserveTaskFrame(options: RunTaskFrameOptions): TaskFrameReservation;
70
70
  /** Restores a captured frame for one synchronous callback segment. */
71
71
  export declare function runWithTaskFrame<T>(frame: TaskFrameToken, work: () => T): T;
72
- export {};
72
+ export { attachTaskProgressReporter, taskProgressReceiverForHost } from '../tasks/progress-bindings.js';
73
+ export type { TaskProgressReceiver } from '../tasks/progress-receiver.js';
73
74
  //# sourceMappingURL=task-frames.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-frames.d.ts","sourceRoot":"","sources":["../../../src/framework/task-frames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUzD,OAAO,CAAC,M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CAAC,CAAC,GACzB,kBAAkB,CAAC,CAAC,CAAC,CAEvB;AA0HD,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,oBAAoB,CAmCnF;AAQD,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAE3E;AAED,OAAO,EACN,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -156,4 +156,5 @@ function rejectedTaskFrameExecution(error) {
156
156
  export function runWithTaskFrame(frame, work) {
157
157
  return withTaskFrameRecord(frame, work);
158
158
  }
159
+ export { attachTaskProgressReporter, taskProgressReceiverForHost } from '../tasks/progress-bindings.js';
159
160
  //# sourceMappingURL=task-frames.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-frames.js","sourceRoot":"","sources":["../../../src/framework/task-frames.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EAEnB,MAAM,2BAA2B,CAAC;AA2DnC,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB;IAC/B,OAAO,sBAAsB,EAAgC,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC3B,OAA4B,EAC5B,KAA2B;IAE3B,OAAO,wBAAwB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,yEAAyE;AACzE,SAAS,wBAAwB,CAChC,OAA4B,EAC5B,KAA2B,EAC3B,cAAuB;IAEvB,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,EAAE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CAAI,KAAqB,EAAE,IAAa;IACvE,OAAO,mBAAmB,CAAC,KAAmC,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { TaskContext } from '../tasks/contracts.js';\nimport { TaskCancellation } from '../tasks/cancellation.js';\nimport {\n\tattachTaskFrameSettlement,\n\tcurrentTaskFrameRecord,\n\texecuteTaskFrame,\n\twithTaskFrameRecord,\n\ttype TaskFrameRecord\n} from '../tasks/frame-runtime.js';\n\ndeclare const taskFrameTokenBrand: unique symbol;\n\n/** Opaque authority identifying a live task frame. */\nexport interface TaskFrameToken {\n\treadonly [taskFrameTokenBrand]: true;\n}\n\n/** Framework-owned child frame policy. */\nexport interface RunTaskFrameOptions {\n\treadonly parent?: TaskFrameToken;\n\treadonly kind: string;\n\treadonly label?: string;\n\treadonly generation?: number;\n\treadonly detached?: boolean;\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly readiness?: 'blocking' | 'nonblocking';\n}\n\n/** Terminal structural outcome reported to framework coordinators. */\nexport type TaskFrameOutcome<T> =\n\t| { readonly status: 'fulfilled'; readonly value: T }\n\t| { readonly status: 'rejected'; readonly error: unknown }\n\t| { readonly status: 'cancelled'; readonly reason: unknown };\n\n/** Foreground readiness outcome reported exactly once. */\nexport type TaskForegroundOutcome =\n\t| { readonly status: 'ready' }\n\t| { readonly status: 'rejected'; readonly error: unknown }\n\t| { readonly status: 'cancelled'; readonly reason: unknown };\n\n/**\n * Structurally settled framework work with cooperative cancellation.\n *\n * Cancelling aborts the frame and every attached descendant. The promise does\n * not settle until foreground work, descendants, and cleanup have responded.\n */\nexport interface TaskFrameExecution<T> extends Promise<T> {\n\t/** Signal inherited by the frame's context and attached descendants. */\n\treadonly signal: AbortSignal;\n\n\t/** Requests cooperative cancellation while preserving structural settlement. */\n\tcancel(reason?: unknown): void;\n}\n\n/** Work and settlement hooks for a framework-created task frame. */\nexport interface RunTaskFrameHooks<T> {\n\twork(context: TaskContext): T | Promise<T>;\n\tafterForeground?(outcome: TaskForegroundOutcome): void | Promise<void>;\n\tafterChildren?(outcome: TaskFrameOutcome<T>): void | Promise<void>;\n}\n\n/** Atomically reserved frame that must be run or released exactly once. */\nexport interface TaskFrameReservation extends Disposable {\n\trun<T>(work: (context: TaskContext) => T | Promise<T>): TaskFrameExecution<T>;\n\tcancel(reason?: unknown): void;\n}\n\n/** Captures the synchronously active opaque task frame. */\nexport function captureTaskFrame(): TaskFrameToken | undefined {\n\treturn currentTaskFrameRecord() as TaskFrameToken | undefined;\n}\n\n/**\n * Runs framework work in a structurally attached, cooperatively cancelable\n * task frame.\n */\nexport function runTaskFrame<T>(\n\toptions: RunTaskFrameOptions,\n\thooks: RunTaskFrameHooks<T>\n): TaskFrameExecution<T> {\n\treturn createTaskFrameExecution(options, hooks, false);\n}\n\n/** Creates the cancelable public execution around one internal frame. */\nfunction createTaskFrameExecution<T>(\n\toptions: RunTaskFrameOptions,\n\thooks: RunTaskFrameHooks<T>,\n\tparentReserved: boolean\n): TaskFrameExecution<T> {\n\tconst controller = new AbortController();\n\tconst execution = runTaskFrameInternal(options, hooks, parentReserved, controller);\n\tconst parent = options.detached\n\t\t? undefined\n\t\t: ((options.parent as TaskFrameRecord | undefined) ?? currentTaskFrameRecord());\n\tif (parent && !parentReserved && parent.producerOpen && !parent.settled)\n\t\tattachTaskFrameSettlement(parent, execution);\n\treturn exposeTaskFrameExecution(execution, controller);\n}\n\n/** Adds framework cancellation authority to a native settlement promise. */\nfunction exposeTaskFrameExecution<T>(\n\texecution: Promise<T>,\n\tcontroller: AbortController\n): TaskFrameExecution<T> {\n\tlet settled = false;\n\tvoid execution.then(\n\t\t() => {\n\t\t\tsettled = true;\n\t\t},\n\t\t() => {\n\t\t\tsettled = true;\n\t\t}\n\t);\n\treturn Object.defineProperties(execution, {\n\t\tsignal: {\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: controller.signal,\n\t\t\twritable: false\n\t\t},\n\t\tcancel: {\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t\tvalue(reason?: unknown) {\n\t\t\t\tif (!settled) controller.abort(reason);\n\t\t\t},\n\t\t\twritable: false\n\t\t}\n\t}) as TaskFrameExecution<T>;\n}\n\nasync function runTaskFrameInternal<T>(\n\toptions: RunTaskFrameOptions,\n\thooks: RunTaskFrameHooks<T>,\n\tparentReserved: boolean,\n\tcontroller: AbortController\n): Promise<T> {\n\tlet foregroundReported = false;\n\tlet childrenReported = false;\n\ttry {\n\t\tconst value = await executeTaskFrame(\n\t\t\t{\n\t\t\t\tparent: options.parent as TaskFrameRecord | undefined,\n\t\t\t\tparentReserved,\n\t\t\t\tcontroller,\n\t\t\t\tgeneration: options.generation,\n\t\t\t\tdetached: options.detached,\n\t\t\t\tkind: options.kind,\n\t\t\t\tlabel: options.label,\n\t\t\t\tpriority: options.priority,\n\t\t\t\treadiness: options.readiness\n\t\t\t},\n\t\t\tasync (context) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await hooks.work(context);\n\t\t\t\t\tforegroundReported = true;\n\t\t\t\t\tawait hooks.afterForeground?.({ status: 'ready' });\n\t\t\t\t\treturn result;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!foregroundReported) {\n\t\t\t\t\t\tforegroundReported = true;\n\t\t\t\t\t\tawait hooks.afterForeground?.(foregroundOutcome(controller.signal, error));\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tchildrenReported = true;\n\t\tawait hooks.afterChildren?.({ status: 'fulfilled', value });\n\t\treturn value;\n\t} catch (error) {\n\t\tif (!foregroundReported) {\n\t\t\tforegroundReported = true;\n\t\t\tawait hooks.afterForeground?.(foregroundOutcome(controller.signal, error));\n\t\t}\n\t\tif (!childrenReported) {\n\t\t\tchildrenReported = true;\n\t\t\tawait hooks.afterChildren?.(structuralOutcome(controller.signal, error));\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/** Classifies foreground failure using the frame's cancellation authority. */\nfunction foregroundOutcome(signal: AbortSignal, error: unknown): TaskForegroundOutcome {\n\treturn signal.aborted || error instanceof TaskCancellation\n\t\t? { status: 'cancelled', reason: cancellationReason(signal, error) }\n\t\t: { status: 'rejected', error };\n}\n\n/** Classifies structural failure using the frame's cancellation authority. */\nfunction structuralOutcome<T>(signal: AbortSignal, error: unknown): TaskFrameOutcome<T> {\n\treturn error instanceof TaskCancellation\n\t\t? { status: 'cancelled', reason: cancellationReason(signal, error) }\n\t\t: { status: 'rejected', error };\n}\n\n/** Preserves the originating abort reason after runtime cancellation wrapping. */\nfunction cancellationReason(signal: AbortSignal, error: unknown): unknown {\n\tif (error instanceof TaskCancellation) return error.reason;\n\treturn signal.aborted ? signal.reason : error;\n}\n\n/** Reserves an attached child before handing work to an external scheduler. */\nexport function reserveTaskFrame(options: RunTaskFrameOptions): TaskFrameReservation {\n\tconst parent = (options.parent as TaskFrameRecord | undefined) ?? currentTaskFrameRecord();\n\tif (!parent) throw new Error('A task frame reservation requires an active or explicit parent');\n\tlet used = false;\n\tlet release!: () => void;\n\tconst placeholder = new Promise<void>((resolve) => {\n\t\trelease = resolve;\n\t});\n\tattachTaskFrameSettlement(parent, placeholder);\n\treturn {\n\t\trun<T>(work: (context: TaskContext) => T | Promise<T>): TaskFrameExecution<T> {\n\t\t\tif (used)\n\t\t\t\treturn rejectedTaskFrameExecution(new Error('Task frame reservation was already released'));\n\t\t\tused = true;\n\t\t\tconst execution = createTaskFrameExecution(\n\t\t\t\t{ ...options, parent: parent as unknown as TaskFrameToken },\n\t\t\t\t{ work },\n\t\t\t\ttrue\n\t\t\t);\n\t\t\t// Keep the atomic placeholder until the public execution, including\n\t\t\t// its structural finalizer, has settled.\n\t\t\tvoid execution.then(release, release);\n\t\t\treturn execution;\n\t\t},\n\t\tcancel() {\n\t\t\tif (used) return;\n\t\t\tused = true;\n\t\t\trelease();\n\t\t},\n\t\t[Symbol.dispose]() {\n\t\t\tif (used) return;\n\t\t\tused = true;\n\t\t\trelease();\n\t\t}\n\t};\n}\n\n/** Creates a settled execution for invalid reservation reuse. */\nfunction rejectedTaskFrameExecution<T>(error: unknown): TaskFrameExecution<T> {\n\tconst controller = new AbortController();\n\treturn exposeTaskFrameExecution(Promise.reject<T>(error), controller);\n}\n\n/** Restores a captured frame for one synchronous callback segment. */\nexport function runWithTaskFrame<T>(frame: TaskFrameToken, work: () => T): T {\n\treturn withTaskFrameRecord(frame as unknown as TaskFrameRecord, work);\n}\n"]}
1
+ {"version":3,"file":"task-frames.js","sourceRoot":"","sources":["../../../src/framework/task-frames.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EAEnB,MAAM,2BAA2B,CAAC;AA2DnC,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB;IAC/B,OAAO,sBAAsB,EAAgC,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC3B,OAA4B,EAC5B,KAA2B;IAE3B,OAAO,wBAAwB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,yEAAyE;AACzE,SAAS,wBAAwB,CAChC,OAA4B,EAC5B,KAA2B,EAC3B,cAAuB;IAEvB,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IACnF,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ;QAC9B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAE,OAAO,CAAC,MAAsC,IAAI,sBAAsB,EAAE,CAAC,CAAC;IACjF,IAAI,MAAM,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,OAAO;QACtE,yBAAyB,CA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,EAAE,WAAW,CAAC,CAAC;IAC/C,OAAO;QACN,GAAG,CAAI,IAA8C;YACpD,IAAI,IAAI;gBACP,OAAO,0BAA0B,CAAC,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC,CAAC;YAC7F,IAAI,GAAG,IAAI,CAAC;YACZ,MAAM,SAAS,GAAG,wBAAwB,CACzC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAmC,EAAE,EAC3D,EAAE,IAAI,EAAE,EACR,IAAI,CACJ,CAAC;YACF,oEAAoE;YACpE,yCAAyC;YACzC,KAAK,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,MAAM;YACL,IAAI,IAAI;gBAAE,OAAO;YACjB,IAAI,GAAG,IAAI,CAAC;YACZ,OAAO,EAAE,CAAC;QACX,CAAC;QACD,CAAC,MAAM,CAAC,OAAO,CAAC;YACf,IAAI,IAAI;gBAAE,OAAO;YACjB,IAAI,GAAG,IAAI,CAAC;YACZ,OAAO,EAAE,CAAC;QACX,CAAC;KACD,CAAC;AACH,CAAC;AAED,iEAAiE;AACjE,SAAS,0BAA0B,CAAI,KAAc;IACpD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,OAAO,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAI,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AACvE,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAAI,KAAqB,EAAE,IAAa;IACvE,OAAO,mBAAmB,CAAC,KAAmC,EAAE,IAAI,CAAC,CAAC;AACvE,CAAC;AAED,OAAO,EACN,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,+BAA+B,CAAC","sourcesContent":["import type { TaskContext } from '../tasks/contracts.js';\nimport { TaskCancellation } from '../tasks/cancellation.js';\nimport {\n\tattachTaskFrameSettlement,\n\tcurrentTaskFrameRecord,\n\texecuteTaskFrame,\n\twithTaskFrameRecord,\n\ttype TaskFrameRecord\n} from '../tasks/frame-runtime.js';\n\ndeclare const taskFrameTokenBrand: unique symbol;\n\n/** Opaque authority identifying a live task frame. */\nexport interface TaskFrameToken {\n\treadonly [taskFrameTokenBrand]: true;\n}\n\n/** Framework-owned child frame policy. */\nexport interface RunTaskFrameOptions {\n\treadonly parent?: TaskFrameToken;\n\treadonly kind: string;\n\treadonly label?: string;\n\treadonly generation?: number;\n\treadonly detached?: boolean;\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly readiness?: 'blocking' | 'nonblocking';\n}\n\n/** Terminal structural outcome reported to framework coordinators. */\nexport type TaskFrameOutcome<T> =\n\t| { readonly status: 'fulfilled'; readonly value: T }\n\t| { readonly status: 'rejected'; readonly error: unknown }\n\t| { readonly status: 'cancelled'; readonly reason: unknown };\n\n/** Foreground readiness outcome reported exactly once. */\nexport type TaskForegroundOutcome =\n\t| { readonly status: 'ready' }\n\t| { readonly status: 'rejected'; readonly error: unknown }\n\t| { readonly status: 'cancelled'; readonly reason: unknown };\n\n/**\n * Structurally settled framework work with cooperative cancellation.\n *\n * Cancelling aborts the frame and every attached descendant. The promise does\n * not settle until foreground work, descendants, and cleanup have responded.\n */\nexport interface TaskFrameExecution<T> extends Promise<T> {\n\t/** Signal inherited by the frame's context and attached descendants. */\n\treadonly signal: AbortSignal;\n\n\t/** Requests cooperative cancellation while preserving structural settlement. */\n\tcancel(reason?: unknown): void;\n}\n\n/** Work and settlement hooks for a framework-created task frame. */\nexport interface RunTaskFrameHooks<T> {\n\twork(context: TaskContext): T | Promise<T>;\n\tafterForeground?(outcome: TaskForegroundOutcome): void | Promise<void>;\n\tafterChildren?(outcome: TaskFrameOutcome<T>): void | Promise<void>;\n}\n\n/** Atomically reserved frame that must be run or released exactly once. */\nexport interface TaskFrameReservation extends Disposable {\n\trun<T>(work: (context: TaskContext) => T | Promise<T>): TaskFrameExecution<T>;\n\tcancel(reason?: unknown): void;\n}\n\n/** Captures the synchronously active opaque task frame. */\nexport function captureTaskFrame(): TaskFrameToken | undefined {\n\treturn currentTaskFrameRecord() as TaskFrameToken | undefined;\n}\n\n/**\n * Runs framework work in a structurally attached, cooperatively cancelable\n * task frame.\n */\nexport function runTaskFrame<T>(\n\toptions: RunTaskFrameOptions,\n\thooks: RunTaskFrameHooks<T>\n): TaskFrameExecution<T> {\n\treturn createTaskFrameExecution(options, hooks, false);\n}\n\n/** Creates the cancelable public execution around one internal frame. */\nfunction createTaskFrameExecution<T>(\n\toptions: RunTaskFrameOptions,\n\thooks: RunTaskFrameHooks<T>,\n\tparentReserved: boolean\n): TaskFrameExecution<T> {\n\tconst controller = new AbortController();\n\tconst execution = runTaskFrameInternal(options, hooks, parentReserved, controller);\n\tconst parent = options.detached\n\t\t? undefined\n\t\t: ((options.parent as TaskFrameRecord | undefined) ?? currentTaskFrameRecord());\n\tif (parent && !parentReserved && parent.producerOpen && !parent.settled)\n\t\tattachTaskFrameSettlement(parent, execution);\n\treturn exposeTaskFrameExecution(execution, controller);\n}\n\n/** Adds framework cancellation authority to a native settlement promise. */\nfunction exposeTaskFrameExecution<T>(\n\texecution: Promise<T>,\n\tcontroller: AbortController\n): TaskFrameExecution<T> {\n\tlet settled = false;\n\tvoid execution.then(\n\t\t() => {\n\t\t\tsettled = true;\n\t\t},\n\t\t() => {\n\t\t\tsettled = true;\n\t\t}\n\t);\n\treturn Object.defineProperties(execution, {\n\t\tsignal: {\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: controller.signal,\n\t\t\twritable: false\n\t\t},\n\t\tcancel: {\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t\tvalue(reason?: unknown) {\n\t\t\t\tif (!settled) controller.abort(reason);\n\t\t\t},\n\t\t\twritable: false\n\t\t}\n\t}) as TaskFrameExecution<T>;\n}\n\nasync function runTaskFrameInternal<T>(\n\toptions: RunTaskFrameOptions,\n\thooks: RunTaskFrameHooks<T>,\n\tparentReserved: boolean,\n\tcontroller: AbortController\n): Promise<T> {\n\tlet foregroundReported = false;\n\tlet childrenReported = false;\n\ttry {\n\t\tconst value = await executeTaskFrame(\n\t\t\t{\n\t\t\t\tparent: options.parent as TaskFrameRecord | undefined,\n\t\t\t\tparentReserved,\n\t\t\t\tcontroller,\n\t\t\t\tgeneration: options.generation,\n\t\t\t\tdetached: options.detached,\n\t\t\t\tkind: options.kind,\n\t\t\t\tlabel: options.label,\n\t\t\t\tpriority: options.priority,\n\t\t\t\treadiness: options.readiness\n\t\t\t},\n\t\t\tasync (context) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await hooks.work(context);\n\t\t\t\t\tforegroundReported = true;\n\t\t\t\t\tawait hooks.afterForeground?.({ status: 'ready' });\n\t\t\t\t\treturn result;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!foregroundReported) {\n\t\t\t\t\t\tforegroundReported = true;\n\t\t\t\t\t\tawait hooks.afterForeground?.(foregroundOutcome(controller.signal, error));\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tchildrenReported = true;\n\t\tawait hooks.afterChildren?.({ status: 'fulfilled', value });\n\t\treturn value;\n\t} catch (error) {\n\t\tif (!foregroundReported) {\n\t\t\tforegroundReported = true;\n\t\t\tawait hooks.afterForeground?.(foregroundOutcome(controller.signal, error));\n\t\t}\n\t\tif (!childrenReported) {\n\t\t\tchildrenReported = true;\n\t\t\tawait hooks.afterChildren?.(structuralOutcome(controller.signal, error));\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/** Classifies foreground failure using the frame's cancellation authority. */\nfunction foregroundOutcome(signal: AbortSignal, error: unknown): TaskForegroundOutcome {\n\treturn signal.aborted || error instanceof TaskCancellation\n\t\t? { status: 'cancelled', reason: cancellationReason(signal, error) }\n\t\t: { status: 'rejected', error };\n}\n\n/** Classifies structural failure using the frame's cancellation authority. */\nfunction structuralOutcome<T>(signal: AbortSignal, error: unknown): TaskFrameOutcome<T> {\n\treturn error instanceof TaskCancellation\n\t\t? { status: 'cancelled', reason: cancellationReason(signal, error) }\n\t\t: { status: 'rejected', error };\n}\n\n/** Preserves the originating abort reason after runtime cancellation wrapping. */\nfunction cancellationReason(signal: AbortSignal, error: unknown): unknown {\n\tif (error instanceof TaskCancellation) return error.reason;\n\treturn signal.aborted ? signal.reason : error;\n}\n\n/** Reserves an attached child before handing work to an external scheduler. */\nexport function reserveTaskFrame(options: RunTaskFrameOptions): TaskFrameReservation {\n\tconst parent = (options.parent as TaskFrameRecord | undefined) ?? currentTaskFrameRecord();\n\tif (!parent) throw new Error('A task frame reservation requires an active or explicit parent');\n\tlet used = false;\n\tlet release!: () => void;\n\tconst placeholder = new Promise<void>((resolve) => {\n\t\trelease = resolve;\n\t});\n\tattachTaskFrameSettlement(parent, placeholder);\n\treturn {\n\t\trun<T>(work: (context: TaskContext) => T | Promise<T>): TaskFrameExecution<T> {\n\t\t\tif (used)\n\t\t\t\treturn rejectedTaskFrameExecution(new Error('Task frame reservation was already released'));\n\t\t\tused = true;\n\t\t\tconst execution = createTaskFrameExecution(\n\t\t\t\t{ ...options, parent: parent as unknown as TaskFrameToken },\n\t\t\t\t{ work },\n\t\t\t\ttrue\n\t\t\t);\n\t\t\t// Keep the atomic placeholder until the public execution, including\n\t\t\t// its structural finalizer, has settled.\n\t\t\tvoid execution.then(release, release);\n\t\t\treturn execution;\n\t\t},\n\t\tcancel() {\n\t\t\tif (used) return;\n\t\t\tused = true;\n\t\t\trelease();\n\t\t},\n\t\t[Symbol.dispose]() {\n\t\t\tif (used) return;\n\t\t\tused = true;\n\t\t\trelease();\n\t\t}\n\t};\n}\n\n/** Creates a settled execution for invalid reservation reuse. */\nfunction rejectedTaskFrameExecution<T>(error: unknown): TaskFrameExecution<T> {\n\tconst controller = new AbortController();\n\treturn exposeTaskFrameExecution(Promise.reject<T>(error), controller);\n}\n\n/** Restores a captured frame for one synchronous callback segment. */\nexport function runWithTaskFrame<T>(frame: TaskFrameToken, work: () => T): T {\n\treturn withTaskFrameRecord(frame as unknown as TaskFrameRecord, work);\n}\n\nexport {\n\tattachTaskProgressReporter,\n\ttaskProgressReceiverForHost\n} from '../tasks/progress-bindings.js';\nexport type { TaskProgressReceiver } from '../tasks/progress-receiver.js';\n"]}
@@ -10,4 +10,5 @@ export { taskMutation } from '../tasks/frame-runtime.js';
10
10
  export { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';
11
11
  export { mutateTaskCollection, ownTaskResource, stageTaskMutation, taskAnimationFrame, taskAwait, taskFetch, taskIdleCallback, taskInterval, taskObserver, taskTimeout } from '../tasks/resources.js';
12
12
  export { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';
13
+ export { createTaskProgressReporter, registerTaskProgressReceiver } from '../tasks/progress-bindings.js';
13
14
  //# sourceMappingURL=tasks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/runtime/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,uCAAuC,EACvC,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/runtime/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,uCAAuC,EACvC,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,EAC5B,MAAM,+BAA+B,CAAC"}
@@ -10,4 +10,5 @@ export { taskMutation } from '../tasks/frame-runtime.js';
10
10
  export { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';
11
11
  export { mutateTaskCollection, ownTaskResource, stageTaskMutation, taskAnimationFrame, taskAwait, taskFetch, taskIdleCallback, taskInterval, taskObserver, taskTimeout } from '../tasks/resources.js';
12
12
  export { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';
13
+ export { createTaskProgressReporter, registerTaskProgressReceiver } from '../tasks/progress-bindings.js';
13
14
  //# sourceMappingURL=tasks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/runtime/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,uCAAuC,EACvC,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["import './component-tasks.js';\n\nexport { registerComponentContinuationContexts } from '../component/context-resumption.js';\nexport { dispatchComponentContinuation } from '../component/domain.js';\nexport { activateTaskForHost } from '../tasks/activation.js';\nexport { activateComputationForHost } from '../tasks/computation-activation.js';\nexport {\n\tcreateIndexedContinuationDependency,\n\tcreateTrackedContinuationDependency\n} from '../tasks/dependency-source.js';\nexport {\n\tactivateCompiledClientLatestTaskForHost,\n\tbindCompiledClientLatestTaskForHost\n} from '../tasks/compiled-latest.js';\nexport { markComponentContinuationTask } from '../tasks/component-continuation.js';\nexport { taskMutation } from '../tasks/frame-runtime.js';\nexport { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';\nexport {\n\tmutateTaskCollection,\n\townTaskResource,\n\tstageTaskMutation,\n\ttaskAnimationFrame,\n\ttaskAwait,\n\ttaskFetch,\n\ttaskIdleCallback,\n\ttaskInterval,\n\ttaskObserver,\n\ttaskTimeout\n} from '../tasks/resources.js';\nexport { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';\n"]}
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/runtime/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACN,mCAAmC,EACnC,mCAAmC,EACnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,uCAAuC,EACvC,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,EAC5B,MAAM,+BAA+B,CAAC","sourcesContent":["import './component-tasks.js';\n\nexport { registerComponentContinuationContexts } from '../component/context-resumption.js';\nexport { dispatchComponentContinuation } from '../component/domain.js';\nexport { activateTaskForHost } from '../tasks/activation.js';\nexport { activateComputationForHost } from '../tasks/computation-activation.js';\nexport {\n\tcreateIndexedContinuationDependency,\n\tcreateTrackedContinuationDependency\n} from '../tasks/dependency-source.js';\nexport {\n\tactivateCompiledClientLatestTaskForHost,\n\tbindCompiledClientLatestTaskForHost\n} from '../tasks/compiled-latest.js';\nexport { markComponentContinuationTask } from '../tasks/component-continuation.js';\nexport { taskMutation } from '../tasks/frame-runtime.js';\nexport { bindTaskForHost, defineTask, invokeTask } from '../tasks/runtime.js';\nexport {\n\tmutateTaskCollection,\n\townTaskResource,\n\tstageTaskMutation,\n\ttaskAnimationFrame,\n\ttaskAwait,\n\ttaskFetch,\n\ttaskIdleCallback,\n\ttaskInterval,\n\ttaskObserver,\n\ttaskTimeout\n} from '../tasks/resources.js';\nexport { combineTaskSignal, withAbortSignal, withTaskSignal } from '../tasks/signals.js';\n\nexport {\n\tcreateTaskProgressReporter,\n\tregisterTaskProgressReceiver\n} from '../tasks/progress-bindings.js';\n"]}
@@ -17,6 +17,8 @@ export interface TaskContext {
17
17
  export interface TaskContextPolicy extends TaskContext {
18
18
  client(): TaskContextPolicy;
19
19
  server(): TaskContextPolicy;
20
+ /** Declares a missable snapshot receiver for browser-initiated server work. */
21
+ progress(): TaskContextPolicy;
20
22
  parallel(): TaskContextPolicy;
21
23
  latest(): TaskContextPolicy;
22
24
  queue(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,UAAU,GAAG,aAAa,CAAC;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,CAAE,SAAQ,UAAU;IACvF,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Describes why a task generation began. */\nexport type TaskActivation =\n\t| 'initialization'\n\t| 'reactive'\n\t| 'interaction'\n\t| 'invoked'\n\t| 'lifecycle';\n\n/** Capabilities scoped to one task frame. */\nexport interface TaskContext {\n\treadonly signal: AbortSignal;\n\treadonly generation: number;\n\treadonly activation: TaskActivation;\n\tpeek<T>(read: () => T): T;\n\toptimistic(work: () => void): void;\n\tcleanup(cleanup: () => void | Promise<void>): void;\n\town<T extends Disposable | AsyncDisposable>(resource: T): T;\n}\n\n/**\n * Declarative task policy accepted only as the default value of a final\n * {@link TaskContext} parameter in compiler-authored source.\n */\nexport interface TaskContextPolicy extends TaskContext {\n\tclient(): TaskContextPolicy;\n\tserver(): TaskContextPolicy;\n\tparallel(): TaskContextPolicy;\n\tlatest(): TaskContextPolicy;\n\tqueue(): TaskContextPolicy;\n\tkey<T>(value: T): TaskContextPolicy;\n\timmediate(): TaskContextPolicy;\n\tnormal(): TaskContextPolicy;\n\tdeferred(): TaskContextPolicy;\n\tblocking(): TaskContextPolicy;\n\tnonblocking(): TaskContextPolicy;\n\tdetached(): TaskContextPolicy;\n}\n\n/** Durable cancellation and concurrency ownership for task generations. */\nexport interface TaskOwner extends AsyncDisposable {\n\treadonly signal: AbortSignal;\n}\n\n/** Owner-bound observable state for one task definition. */\nexport interface TaskStatus<Result> {\n\treadonly pending: boolean;\n\treadonly pendingCount: number;\n\treadonly generation: number;\n\treadonly result: Result | undefined;\n\treadonly error: unknown;\n\tcancel(reason?: unknown): void;\n}\n\n/** A thenable whose result settles only after its attached task subtree. */\nexport interface TaskInvocation<Result> extends PromiseLike<Result> {\n\tthen<TResult1 = Result, TResult2 = never>(\n\t\tonFulfilled?: ((value: Result) => TResult1 | PromiseLike<TResult1>) | null,\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null\n\t): TaskInvocation<TResult1 | TResult2>;\n\tcatch<TResult = never>(\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null\n\t): TaskInvocation<Result | TResult>;\n\tfinally(onFinally?: (() => void) | null): TaskInvocation<Result>;\n\treadonly [Symbol.toStringTag]: 'TaskInvocation';\n}\n\n/** Callable runtime task definition. */\nexport interface TaskFunction<Args extends unknown[], Result> {\n\t(...args: Args): TaskInvocation<Result>;\n}\n\n/** Existential task function retained where authored argument tuples are not inspected. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Runtime task registries preserve arbitrary authored argument tuples through callable identity.\nexport type AnyTaskFunction<Result = unknown> = TaskFunction<any[], Result>;\n\n/** Owner-bound task callable with aggregate status. */\nexport interface BoundTaskFunction<Args extends unknown[], Result>\n\textends TaskFunction<Args, Result>,\n\t\tTaskStatus<Result> {}\n\n/** Runtime policy required when an integration defines a task outside compiled component source. */\nexport interface RuntimeTaskOptions<Args extends unknown[]> {\n\treadonly label?: string;\n\treadonly placement?: 'current' | 'client' | 'server';\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly concurrency?: 'parallel' | 'latest' | 'queue';\n\treadonly concurrencyKey?: (...args: Args) => unknown;\n\t/**\n\t * Compiler-generated resolver for defaulted task parameters. It evaluates\n\t * omitted defaults once per generation without subscribing the task to\n\t * reactive reads performed while resolving them.\n\t */\n\treadonly captureArguments?: (args: unknown[]) => readonly unknown[];\n\treadonly readiness?: 'blocking' | 'nonblocking';\n\treadonly detached?: boolean;\n\treadonly owner?: TaskOwner;\n}\n\n/** Reserved callback that must run or be explicitly released exactly once. */\nexport interface ReservedTaskCallback<Args extends unknown[], Result> extends Disposable {\n\t(...args: Args): Result;\n\tcancel(reason?: unknown): void;\n}\n"]}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Describes why a task generation began. */\nexport type TaskActivation =\n\t| 'initialization'\n\t| 'reactive'\n\t| 'interaction'\n\t| 'invoked'\n\t| 'lifecycle';\n\n/** Capabilities scoped to one task frame. */\nexport interface TaskContext {\n\treadonly signal: AbortSignal;\n\treadonly generation: number;\n\treadonly activation: TaskActivation;\n\tpeek<T>(read: () => T): T;\n\toptimistic(work: () => void): void;\n\tcleanup(cleanup: () => void | Promise<void>): void;\n\town<T extends Disposable | AsyncDisposable>(resource: T): T;\n}\n\n/**\n * Declarative task policy accepted only as the default value of a final\n * {@link TaskContext} parameter in compiler-authored source.\n */\nexport interface TaskContextPolicy extends TaskContext {\n\tclient(): TaskContextPolicy;\n\tserver(): TaskContextPolicy;\n\t/** Declares a missable snapshot receiver for browser-initiated server work. */\n\tprogress(): TaskContextPolicy;\n\tparallel(): TaskContextPolicy;\n\tlatest(): TaskContextPolicy;\n\tqueue(): TaskContextPolicy;\n\tkey<T>(value: T): TaskContextPolicy;\n\timmediate(): TaskContextPolicy;\n\tnormal(): TaskContextPolicy;\n\tdeferred(): TaskContextPolicy;\n\tblocking(): TaskContextPolicy;\n\tnonblocking(): TaskContextPolicy;\n\tdetached(): TaskContextPolicy;\n}\n\n/** Durable cancellation and concurrency ownership for task generations. */\nexport interface TaskOwner extends AsyncDisposable {\n\treadonly signal: AbortSignal;\n}\n\n/** Owner-bound observable state for one task definition. */\nexport interface TaskStatus<Result> {\n\treadonly pending: boolean;\n\treadonly pendingCount: number;\n\treadonly generation: number;\n\treadonly result: Result | undefined;\n\treadonly error: unknown;\n\tcancel(reason?: unknown): void;\n}\n\n/** A thenable whose result settles only after its attached task subtree. */\nexport interface TaskInvocation<Result> extends PromiseLike<Result> {\n\tthen<TResult1 = Result, TResult2 = never>(\n\t\tonFulfilled?: ((value: Result) => TResult1 | PromiseLike<TResult1>) | null,\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null\n\t): TaskInvocation<TResult1 | TResult2>;\n\tcatch<TResult = never>(\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null\n\t): TaskInvocation<Result | TResult>;\n\tfinally(onFinally?: (() => void) | null): TaskInvocation<Result>;\n\treadonly [Symbol.toStringTag]: 'TaskInvocation';\n}\n\n/** Callable runtime task definition. */\nexport interface TaskFunction<Args extends unknown[], Result> {\n\t(...args: Args): TaskInvocation<Result>;\n}\n\n/** Existential task function retained where authored argument tuples are not inspected. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Runtime task registries preserve arbitrary authored argument tuples through callable identity.\nexport type AnyTaskFunction<Result = unknown> = TaskFunction<any[], Result>;\n\n/** Owner-bound task callable with aggregate status. */\nexport interface BoundTaskFunction<Args extends unknown[], Result>\n\textends TaskFunction<Args, Result>,\n\t\tTaskStatus<Result> {}\n\n/** Runtime policy required when an integration defines a task outside compiled component source. */\nexport interface RuntimeTaskOptions<Args extends unknown[]> {\n\treadonly label?: string;\n\treadonly placement?: 'current' | 'client' | 'server';\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly concurrency?: 'parallel' | 'latest' | 'queue';\n\treadonly concurrencyKey?: (...args: Args) => unknown;\n\t/**\n\t * Compiler-generated resolver for defaulted task parameters. It evaluates\n\t * omitted defaults once per generation without subscribing the task to\n\t * reactive reads performed while resolving them.\n\t */\n\treadonly captureArguments?: (args: unknown[]) => readonly unknown[];\n\treadonly readiness?: 'blocking' | 'nonblocking';\n\treadonly detached?: boolean;\n\treadonly owner?: TaskOwner;\n}\n\n/** Reserved callback that must run or be explicitly released exactly once. */\nexport interface ReservedTaskCallback<Args extends unknown[], Result> extends Disposable {\n\t(...args: Args): Result;\n\tcancel(reason?: unknown): void;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { RuntimeTaskOptions, TaskContext } from './contracts.js';
2
+ import type { AnyComponentInstance } from '../component/contracts.js';
3
+ import { type TaskProgressReceiver } from './progress-receiver.js';
4
+ /** Compiler-owned receiver work. Only validated snapshot arguments reach this boundary. */
5
+ export type TaskProgressWork = (snapshot: unknown, task: TaskContext) => void | Promise<void>;
6
+ type ProgressReceiverOptions = Pick<RuntimeTaskOptions<[unknown]>, 'label' | 'priority' | 'readiness'>;
7
+ /** Registers one compiled receiver against its durable component, without activating it. */
8
+ export declare function registerTaskProgressReceiver<Snapshot>(host: object, id: string, work: (snapshot: Snapshot, task: TaskContext) => void | Promise<void>, options: ProgressReceiverOptions): (snapshot: Snapshot) => void;
9
+ /** Binds a server frame to its trusted, invocation-local progress transport. */
10
+ export declare function attachTaskProgressReporter(task: TaskContext, report: (id: string, snapshot: unknown) => void): void;
11
+ /**
12
+ * Captures explicit server progress authority while an executor establishes its lexical tasks.
13
+ * SSR has no transport and therefore creates a no-op. Retained callbacks stop at cancellation
14
+ * or settlement even if application code invokes them after the originating frame has closed.
15
+ */
16
+ export declare function createTaskProgressReporter(id: string, task?: TaskContext): (snapshot: unknown) => void;
17
+ /** Creates an isolated receiver lane for a validated operation and live component instance. */
18
+ export declare function taskProgressReceiverForHost(host: AnyComponentInstance, id: string, signal: AbortSignal): TaskProgressReceiver<unknown>;
19
+ export {};
20
+ //# sourceMappingURL=progress-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-bindings.d.ts","sourceRoot":"","sources":["../../../src/tasks/progress-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9F,KAAK,uBAAuB,GAAG,IAAI,CAClC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,EAC7B,OAAO,GAAG,UAAU,GAAG,WAAW,CAClC,CAAC;AAOF,4FAA4F;AAC5F,wBAAgB,4BAA4B,CAAC,QAAQ,EACpD,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACrE,OAAO,EAAE,uBAAuB,GAC9B,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAQ9B;AAED,gFAAgF;AAChF,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,GAC7C,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,WAAW,GAChB,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAO7B;AAED,+FAA+F;AAC/F,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,oBAAoB,EAC1B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,WAAW,GACjB,oBAAoB,CAAC,OAAO,CAAC,CAgB/B"}
@@ -0,0 +1,51 @@
1
+ import { componentLogMethod } from '../component/log.js';
2
+ import { frameForTaskContext } from './frame-runtime.js';
3
+ import { taskOwnerForHost } from './owner-hosts.js';
4
+ import { createTaskProgressReceiver } from './progress-receiver.js';
5
+ const receivers = new WeakMap();
6
+ const reporters = new WeakMap();
7
+ /** Registers one compiled receiver against its durable component, without activating it. */
8
+ export function registerTaskProgressReceiver(host, id, work, options) {
9
+ let registry = receivers.get(host);
10
+ if (!registry)
11
+ receivers.set(host, (registry = new Map()));
12
+ if (registry.has(id))
13
+ throw new Error(`Duplicate task progress receiver ${id}`);
14
+ registry.set(id, { work: work, options });
15
+ return () => {
16
+ throw new Error('Progress receivers are invoked by server continuation progress');
17
+ };
18
+ }
19
+ /** Binds a server frame to its trusted, invocation-local progress transport. */
20
+ export function attachTaskProgressReporter(task, report) {
21
+ reporters.set(frameForTaskContext(task), report);
22
+ }
23
+ /**
24
+ * Captures explicit server progress authority while an executor establishes its lexical tasks.
25
+ * SSR has no transport and therefore creates a no-op. Retained callbacks stop at cancellation
26
+ * or settlement even if application code invokes them after the originating frame has closed.
27
+ */
28
+ export function createTaskProgressReporter(id, task) {
29
+ const ownedFrame = task && frameForTaskContext(task);
30
+ const report = ownedFrame && reporters.get(ownedFrame);
31
+ return (snapshot) => {
32
+ if (ownedFrame && !ownedFrame.settled && !ownedFrame.controller.signal.aborted)
33
+ report?.(id, snapshot);
34
+ };
35
+ }
36
+ /** Creates an isolated receiver lane for a validated operation and live component instance. */
37
+ export function taskProgressReceiverForHost(host, id, signal) {
38
+ const owner = taskOwnerForHost(host);
39
+ const receiver = receivers.get(host)?.get(id);
40
+ if (!owner || !receiver)
41
+ throw new Error(`Unknown component task progress receiver ${id}`);
42
+ return createTaskProgressReceiver({
43
+ owner,
44
+ signal,
45
+ ...receiver.options,
46
+ label: receiver.options.label ?? id,
47
+ receive: receiver.work,
48
+ onError: (error) => componentLogMethod(host, 'error')?.(() => ['Task progress receiver failed', error, { receiver: id }])
49
+ });
50
+ }
51
+ //# sourceMappingURL=progress-bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-bindings.js","sourceRoot":"","sources":["../../../src/tasks/progress-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rD,MAAM,MAAM,GAAG,UAAU,IAAI,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvD,OAAO,CAAC,QAAQ,EAAE,EAAE;QACnB,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO;YAC7E,MAAM,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,2BAA2B,CAC1C,IAA0B,EAC1B,EAAU,EACV,MAAmB;IAEnB,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,EAAE,EAAE,CAAC,CAAC;IAC3F,OAAO,0BAA0B,CAAC;QACjC,KAAK;QACL,MAAM;QACN,GAAG,QAAQ,CAAC,OAAO;QACnB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;QACnC,OAAO,EAAE,QAAQ,CAAC,IAAI;QACtB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,kBAAkB,CACjB,IAAI,EACJ,OAAO,CACP,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,+BAA+B,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;KACtE,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { RuntimeTaskOptions, TaskContext } from './contracts.js';\nimport type { AnyComponentInstance } from '../component/contracts.js';\nimport { componentLogMethod } from '../component/log.js';\nimport { frameForTaskContext } from './frame-runtime.js';\nimport type { TaskFrameRecord } from './frame-contracts.js';\nimport { taskOwnerForHost } from './owner-hosts.js';\nimport { createTaskProgressReceiver, type TaskProgressReceiver } from './progress-receiver.js';\n\n/** Compiler-owned receiver work. Only validated snapshot arguments reach this boundary. */\nexport type TaskProgressWork = (snapshot: unknown, task: TaskContext) => void | Promise<void>;\n\ntype ProgressReceiverOptions = Pick<\n\tRuntimeTaskOptions<[unknown]>,\n\t'label' | 'priority' | 'readiness'\n>;\nconst receivers = new WeakMap<\n\tobject,\n\tMap<string, { work: TaskProgressWork; options: ProgressReceiverOptions }>\n>();\nconst reporters = new WeakMap<TaskFrameRecord, (id: string, snapshot: unknown) => void>();\n\n/** Registers one compiled receiver against its durable component, without activating it. */\nexport function registerTaskProgressReceiver<Snapshot>(\n\thost: object,\n\tid: string,\n\twork: (snapshot: Snapshot, task: TaskContext) => void | Promise<void>,\n\toptions: ProgressReceiverOptions\n): (snapshot: Snapshot) => void {\n\tlet registry = receivers.get(host);\n\tif (!registry) receivers.set(host, (registry = new Map()));\n\tif (registry.has(id)) throw new Error(`Duplicate task progress receiver ${id}`);\n\tregistry.set(id, { work: work as TaskProgressWork, options });\n\treturn () => {\n\t\tthrow new Error('Progress receivers are invoked by server continuation progress');\n\t};\n}\n\n/** Binds a server frame to its trusted, invocation-local progress transport. */\nexport function attachTaskProgressReporter(\n\ttask: TaskContext,\n\treport: (id: string, snapshot: unknown) => void\n): void {\n\treporters.set(frameForTaskContext(task), report);\n}\n\n/**\n * Captures explicit server progress authority while an executor establishes its lexical tasks.\n * SSR has no transport and therefore creates a no-op. Retained callbacks stop at cancellation\n * or settlement even if application code invokes them after the originating frame has closed.\n */\nexport function createTaskProgressReporter(\n\tid: string,\n\ttask?: TaskContext\n): (snapshot: unknown) => void {\n\tconst ownedFrame = task && frameForTaskContext(task);\n\tconst report = ownedFrame && reporters.get(ownedFrame);\n\treturn (snapshot) => {\n\t\tif (ownedFrame && !ownedFrame.settled && !ownedFrame.controller.signal.aborted)\n\t\t\treport?.(id, snapshot);\n\t};\n}\n\n/** Creates an isolated receiver lane for a validated operation and live component instance. */\nexport function taskProgressReceiverForHost(\n\thost: AnyComponentInstance,\n\tid: string,\n\tsignal: AbortSignal\n): TaskProgressReceiver<unknown> {\n\tconst owner = taskOwnerForHost(host);\n\tconst receiver = receivers.get(host)?.get(id);\n\tif (!owner || !receiver) throw new Error(`Unknown component task progress receiver ${id}`);\n\treturn createTaskProgressReceiver({\n\t\towner,\n\t\tsignal,\n\t\t...receiver.options,\n\t\tlabel: receiver.options.label ?? id,\n\t\treceive: receiver.work,\n\t\tonError: (error) =>\n\t\t\tcomponentLogMethod(\n\t\t\t\thost,\n\t\t\t\t'error'\n\t\t\t)?.(() => ['Task progress receiver failed', error, { receiver: id }])\n\t});\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import type { TaskContext, TaskOwner } from './contracts.js';
2
+ /** One replaceable observation lane, owned by an originating invocation. */
3
+ export interface TaskProgressReceiver<Snapshot> {
4
+ /** Offers a captured snapshot, replacing any snapshot which has not started. */
5
+ report(snapshot: Snapshot): void;
6
+ /** Fences publication immediately; asynchronous cleanup does not delay the caller. */
7
+ close(reason?: unknown): void;
8
+ }
9
+ /**
10
+ * Serializes asynchronous progress activations while retaining only the latest pending value.
11
+ * Each activation is an ordinary task with independent staged publication and structural children.
12
+ * It belongs to the durable component owner, but never extends the originating invocation.
13
+ * Callers must capture/validate snapshots before offering them and route errors to diagnostics.
14
+ */
15
+ export declare function createTaskProgressReceiver<Snapshot>(options: {
16
+ readonly owner: TaskOwner;
17
+ readonly signal: AbortSignal;
18
+ readonly label: string;
19
+ readonly priority?: 'immediate' | 'normal' | 'deferred';
20
+ readonly readiness?: 'blocking' | 'nonblocking';
21
+ readonly receive: (snapshot: Snapshot, task: TaskContext) => void | Promise<void>;
22
+ readonly onError: (error: unknown) => void;
23
+ }): TaskProgressReceiver<Snapshot>;
24
+ //# sourceMappingURL=progress-receiver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-receiver.d.ts","sourceRoot":"","sources":["../../../src/tasks/progress-receiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK7D,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB,CAAC,QAAQ;IAC7C,gFAAgF;IAChF,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IACjC,sFAAsF;IACtF,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,EAAE;IAC7D,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IAChD,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAoEjC"}
@@ -0,0 +1,71 @@
1
+ import { isTaskCancellation } from './cancellation.js';
2
+ import { bindTask, defineTask } from './runtime.js';
3
+ import { logFrameworkEvent } from '../component/log.js';
4
+ /**
5
+ * Serializes asynchronous progress activations while retaining only the latest pending value.
6
+ * Each activation is an ordinary task with independent staged publication and structural children.
7
+ * It belongs to the durable component owner, but never extends the originating invocation.
8
+ * Callers must capture/validate snapshots before offering them and route errors to diagnostics.
9
+ */
10
+ export function createTaskProgressReceiver(options) {
11
+ const task = bindTask(defineTask({
12
+ label: options.label,
13
+ placement: 'client',
14
+ readiness: options.readiness ?? 'nonblocking',
15
+ priority: options.priority,
16
+ detached: true,
17
+ owner: options.owner
18
+ }, options.receive), { owner: options.owner });
19
+ let closed = false;
20
+ let running = false;
21
+ let pending;
22
+ const close = (reason = 'progress-complete') => {
23
+ if (closed)
24
+ return;
25
+ closed = true;
26
+ pending = undefined;
27
+ options.signal.removeEventListener('abort', abort);
28
+ options.owner.signal.removeEventListener('abort', abort);
29
+ task.cancel(reason);
30
+ };
31
+ const abort = () => close(options.signal.reason ?? options.owner.signal.reason);
32
+ const drain = () => {
33
+ if (closed || running || !pending)
34
+ return;
35
+ const { snapshot } = pending;
36
+ pending = undefined;
37
+ running = true;
38
+ // Observe the invocation's rejection before work can settle. Cancellation is lifecycle,
39
+ // while failures still remain inspectable on the task and reach the supplied diagnostic.
40
+ void Promise.resolve(task(snapshot)).then(() => finish(), (error) => {
41
+ try {
42
+ if (!isTaskCancellation(error))
43
+ options.onError(error);
44
+ }
45
+ catch (diagnosticError) {
46
+ logFrameworkEvent('error', 'core', 'task', 'progress error diagnostic failed', diagnosticError);
47
+ }
48
+ finally {
49
+ finish();
50
+ }
51
+ });
52
+ };
53
+ const finish = () => {
54
+ running = false;
55
+ drain();
56
+ };
57
+ options.signal.addEventListener('abort', abort, { once: true });
58
+ options.owner.signal.addEventListener('abort', abort, { once: true });
59
+ if (options.signal.aborted || options.owner.signal.aborted)
60
+ abort();
61
+ return {
62
+ report(snapshot) {
63
+ if (closed)
64
+ return;
65
+ pending = { snapshot };
66
+ drain();
67
+ },
68
+ close
69
+ };
70
+ }
71
+ //# sourceMappingURL=progress-receiver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-receiver.js","sourceRoot":"","sources":["../../../src/tasks/progress-receiver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,O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ancellation } from './cancellation.js';\nimport { bindTask, defineTask } from './runtime.js';\nimport { logFrameworkEvent } from '../component/log.js';\n\n/** One replaceable observation lane, owned by an originating invocation. */\nexport interface TaskProgressReceiver<Snapshot> {\n\t/** Offers a captured snapshot, replacing any snapshot which has not started. */\n\treport(snapshot: Snapshot): void;\n\t/** Fences publication immediately; asynchronous cleanup does not delay the caller. */\n\tclose(reason?: unknown): void;\n}\n\n/**\n * Serializes asynchronous progress activations while retaining only the latest pending value.\n * Each activation is an ordinary task with independent staged publication and structural children.\n * It belongs to the durable component owner, but never extends the originating invocation.\n * Callers must capture/validate snapshots before offering them and route errors to diagnostics.\n */\nexport function createTaskProgressReceiver<Snapshot>(options: {\n\treadonly owner: TaskOwner;\n\treadonly signal: AbortSignal;\n\treadonly label: string;\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly readiness?: 'blocking' | 'nonblocking';\n\treadonly receive: (snapshot: Snapshot, task: TaskContext) => void | Promise<void>;\n\treadonly onError: (error: unknown) => void;\n}): TaskProgressReceiver<Snapshot> {\n\tconst task = bindTask(\n\t\tdefineTask<[Snapshot], void>(\n\t\t\t{\n\t\t\t\tlabel: options.label,\n\t\t\t\tplacement: 'client',\n\t\t\t\treadiness: options.readiness ?? 'nonblocking',\n\t\t\t\tpriority: options.priority,\n\t\t\t\tdetached: true,\n\t\t\t\towner: options.owner\n\t\t\t},\n\t\t\toptions.receive\n\t\t),\n\t\t{ owner: options.owner }\n\t);\n\tlet closed = false;\n\tlet running = false;\n\tlet pending: { snapshot: Snapshot } | undefined;\n\tconst close = (reason: unknown = 'progress-complete') => {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\tpending = undefined;\n\t\toptions.signal.removeEventListener('abort', abort);\n\t\toptions.owner.signal.removeEventListener('abort', abort);\n\t\ttask.cancel(reason);\n\t};\n\tconst abort = () => close(options.signal.reason ?? options.owner.signal.reason);\n\tconst drain = () => {\n\t\tif (closed || running || !pending) return;\n\t\tconst { snapshot } = pending;\n\t\tpending = undefined;\n\t\trunning = true;\n\t\t// Observe the invocation's rejection before work can settle. Cancellation is lifecycle,\n\t\t// while failures still remain inspectable on the task and reach the supplied diagnostic.\n\t\tvoid Promise.resolve(task(snapshot)).then(\n\t\t\t() => finish(),\n\t\t\t(error: unknown) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (!isTaskCancellation(error)) options.onError(error);\n\t\t\t\t} catch (diagnosticError) {\n\t\t\t\t\tlogFrameworkEvent(\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t'core',\n\t\t\t\t\t\t'task',\n\t\t\t\t\t\t'progress error diagnostic failed',\n\t\t\t\t\t\tdiagnosticError\n\t\t\t\t\t);\n\t\t\t\t} finally {\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t};\n\tconst finish = () => {\n\t\trunning = false;\n\t\tdrain();\n\t};\n\toptions.signal.addEventListener('abort', abort, { once: true });\n\toptions.owner.signal.addEventListener('abort', abort, { once: true });\n\tif (options.signal.aborted || options.owner.signal.aborted) abort();\n\treturn {\n\t\treport(snapshot) {\n\t\t\tif (closed) return;\n\t\t\tpending = { snapshot };\n\t\t\tdrain();\n\t\t},\n\t\tclose\n\t};\n}\n"]}
@@ -8,4 +8,9 @@ export declare function isExactContinuationInvocation(value: unknown, options: {
8
8
  }): boolean;
9
9
  /** Reports whether a generated continuation state-path descriptor is valid. */
10
10
  export declare function isExactContinuationStatePath(value: unknown): value is ExactContinuationStatePathContract;
11
+ /** Validates readable attribution and opaque identity for a compiled progress receiver. */
12
+ export declare function isExactProgressReceiver(value: unknown): value is Readonly<{
13
+ id: string;
14
+ label: string;
15
+ }>;
11
16
  //# sourceMappingURL=continuation-validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"continuation-validation.d.ts","sourceRoot":"","sources":["../../src/component-contract/continuation-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kCAAkC,EAClC,kCAAkC,EAClC,MAAM,2BAA2B,CAAC;AAGnC,kFAAkF;AAClF,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,kCAAkC,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAYrE;AAED,6FAA6F;AAC7F,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,kCAAkC,CAAC,YAAY,CAAC,CAAC;AAC7D,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;IAAE,iBAAiB,EAAE,IAAI,CAAA;CAAE,GAClC,OAAO,CAAC;AA4BX,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,kCAAkC,CAc7C"}
1
+ {"version":3,"file":"continuation-validation.d.ts","sourceRoot":"","sources":["../../src/component-contract/continuation-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kCAAkC,EAClC,kCAAkC,EAClC,MAAM,2BAA2B,CAAC;AAGnC,kFAAkF;AAClF,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,kCAAkC,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAYrE;AAED,6FAA6F;AAC7F,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,kCAAkC,CAAC,YAAY,CAAC,CAAC;AAC7D,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;IAAE,iBAAiB,EAAE,IAAI,CAAA;CAAE,GAClC,OAAO,CAAC;AA4BX,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,kCAAkC,CAc7C;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAOlD"}
@@ -43,4 +43,11 @@ export function isExactContinuationStatePath(value) {
43
43
  value.operation === 'map' ||
44
44
  value.operation === 'set'));
45
45
  }
46
+ /** Validates readable attribution and opaque identity for a compiled progress receiver. */
47
+ export function isExactProgressReceiver(value) {
48
+ return (isContractRecord(value) &&
49
+ hasOnlyContractKeys(value, ['id', 'label']) &&
50
+ isContractString(value.id) &&
51
+ isContractString(value.label));
52
+ }
46
53
  //# sourceMappingURL=continuation-validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"continuation-validation.js","sourceRoot":"","sources":["../../src/component-contract/continuation-validation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEnG,kFAAkF;AAClF,MAAM,UAAU,6BAA6B,CAC5C,KAAc;IAEd,OAAO,CACN,gBAAgB,CAAC,KAAK,CAAC;QACvB,mBAAmB,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS;YACzB,CAAC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QAC5F,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC,KAAK,CAAC,MAAM,KAAK,OAAO;YACxB,KAAK,CAAC,MAAM,KAAK,OAAO;YACxB,KAAK,CAAC,MAAM,KAAK,SAAS;YAC1B,KAAK,CAAC,MAAM,KAAK,UAAU,CAAC,CAC7B,CAAC;AACH,CAAC;AAUD,MAAM,UAAU,6BAA6B,CAC5C,KAAc,EACd,UAA2C,EAAE;IAE7C,IAAI,CAAC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AAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;QACjD,CAAC,KAAK,CAAC,UAAU,KAAK,OAAO;YAC5B,KAAK,CAAC,UAAU,KAAK,OAAO;YAC5B,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC;QAChC,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS;YAC7B,KAAK,CAAC,SAAS,KAAK,OAAO;YAC3B,KAAK,CAAC,SAAS,KAAK,KAAK;YACzB,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,CAC3B,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tExactComponentContinuationContract,\n\tExactContinuationStatePathContract\n} from '../component-contracts.js';\nimport { hasOnlyContractKeys, isContractRecord, isContractString } from './metadata-validation.js';\n\n/** Reports whether a generated continuation dependency has a supported source. */\nexport function isExactContinuationDependency(\n\tvalue: unknown\n): value is ExactComponentContinuationContract['dependencies'][number] {\n\treturn (\n\t\tisContractRecord(value) &&\n\t\thasOnlyContractKeys(value, ['index', 'source', 'path']) &&\n\t\t(value.index === undefined ||\n\t\t\t(typeof value.index === 'number' && Number.isSafeInteger(value.index) && value.index >= 0)) &&\n\t\t(value.path === undefined || isContractString(value.path)) &&\n\t\t(value.source === 'state' ||\n\t\t\tvalue.source === 'props' ||\n\t\t\tvalue.source === 'derived' ||\n\t\t\tvalue.source === 'argument')\n\t);\n}\n\n/** Reports whether generated continuation invocation metadata has a valid protocol shape. */\nexport function isExactContinuationInvocation(\n\tvalue: unknown\n): value is ExactComponentContinuationContract['invocation'];\nexport function isExactContinuationInvocation(\n\tvalue: unknown,\n\toptions: { argumentsOptional: true }\n): boolean;\nexport function isExactContinuationInvocation(\n\tvalue: unknown,\n\toptions: { argumentsOptional?: boolean } = {}\n): boolean {\n\tif (!isContractRecord(value) || !hasOnlyContractKeys(value, ['arguments', 'concurrency']))\n\t\treturn false;\n\tconst argumentsValue = value.arguments;\n\treturn (\n\t\t((options.argumentsOptional && argumentsValue === undefined) ||\n\t\t\t(Array.isArray(argumentsValue) &&\n\t\t\t\targumentsValue.every(\n\t\t\t\t\t(argument) =>\n\t\t\t\t\t\tisContractRecord(argument) &&\n\t\t\t\t\t\thasOnlyContractKeys(argument, ['index', 'source', 'path']) &&\n\t\t\t\t\t\t(argument.index === undefined ||\n\t\t\t\t\t\t\t(typeof argument.index === 'number' &&\n\t\t\t\t\t\t\t\tNumber.isSafeInteger(argument.index) &&\n\t\t\t\t\t\t\t\targument.index >= 0)) &&\n\t\t\t\t\t\t(argument.path === undefined || isContractString(argument.path)) &&\n\t\t\t\t\t\targument.source === 'argument'\n\t\t\t\t))) &&\n\t\t(value.concurrency === 'parallel' ||\n\t\t\tvalue.concurrency === 'latest' ||\n\t\t\tvalue.concurrency === 'queue')\n\t);\n}\n\n/** Reports whether a generated continuation state-path descriptor is valid. */\nexport function isExactContinuationStatePath(\n\tvalue: unknown\n): value is ExactContinuationStatePathContract {\n\treturn (\n\t\tisContractRecord(value) &&\n\t\thasOnlyContractKeys(value, ['path', 'kind', 'confidence', 'operation']) &&\n\t\tisContractString(value.path) &&\n\t\t(value.kind === 'read' || value.kind === 'write') &&\n\t\t(value.confidence === 'exact' ||\n\t\t\tvalue.confidence === 'broad' ||\n\t\t\tvalue.confidence === 'unknown') &&\n\t\t(value.operation === undefined ||\n\t\t\tvalue.operation === 'value' ||\n\t\t\tvalue.operation === 'map' ||\n\t\t\tvalue.operation === 'set')\n\t);\n}\n"]}
1
+ {"version":3,"file":"continuation-validation.js","sourceRoot":"","sources":["../../src/component-contract/continuation-validation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEnG,kFAAkF;AAClF,MAAM,UAAU,6BAA6B,CAC5C,KAAc;IAEd,OAAO,CACN,gBAAgB,CAAC,KAAK,CAAC;QACvB,mBAAmB,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,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Content":["import type {\n\tExactComponentContinuationContract,\n\tExactContinuationStatePathContract\n} from '../component-contracts.js';\nimport { hasOnlyContractKeys, isContractRecord, isContractString } from './metadata-validation.js';\n\n/** Reports whether a generated continuation dependency has a supported source. */\nexport function isExactContinuationDependency(\n\tvalue: unknown\n): value is ExactComponentContinuationContract['dependencies'][number] {\n\treturn (\n\t\tisContractRecord(value) &&\n\t\thasOnlyContractKeys(value, ['index', 'source', 'path']) &&\n\t\t(value.index === undefined ||\n\t\t\t(typeof value.index === 'number' && Number.isSafeInteger(value.index) && value.index >= 0)) &&\n\t\t(value.path === undefined || isContractString(value.path)) &&\n\t\t(value.source === 'state' ||\n\t\t\tvalue.source === 'props' ||\n\t\t\tvalue.source === 'derived' ||\n\t\t\tvalue.source === 'argument')\n\t);\n}\n\n/** Reports whether generated continuation invocation metadata has a valid protocol shape. */\nexport function isExactContinuationInvocation(\n\tvalue: unknown\n): value is ExactComponentContinuationContract['invocation'];\nexport function isExactContinuationInvocation(\n\tvalue: unknown,\n\toptions: { argumentsOptional: true }\n): boolean;\nexport function isExactContinuationInvocation(\n\tvalue: unknown,\n\toptions: { argumentsOptional?: boolean } = {}\n): boolean {\n\tif (!isContractRecord(value) || !hasOnlyContractKeys(value, ['arguments', 'concurrency']))\n\t\treturn false;\n\tconst argumentsValue = value.arguments;\n\treturn (\n\t\t((options.argumentsOptional && argumentsValue === undefined) ||\n\t\t\t(Array.isArray(argumentsValue) &&\n\t\t\t\targumentsValue.every(\n\t\t\t\t\t(argument) =>\n\t\t\t\t\t\tisContractRecord(argument) &&\n\t\t\t\t\t\thasOnlyContractKeys(argument, ['index', 'source', 'path']) &&\n\t\t\t\t\t\t(argument.index === undefined ||\n\t\t\t\t\t\t\t(typeof argument.index === 'number' &&\n\t\t\t\t\t\t\t\tNumber.isSafeInteger(argument.index) &&\n\t\t\t\t\t\t\t\targument.index >= 0)) &&\n\t\t\t\t\t\t(argument.path === undefined || isContractString(argument.path)) &&\n\t\t\t\t\t\targument.source === 'argument'\n\t\t\t\t))) &&\n\t\t(value.concurrency === 'parallel' ||\n\t\t\tvalue.concurrency === 'latest' ||\n\t\t\tvalue.concurrency === 'queue')\n\t);\n}\n\n/** Reports whether a generated continuation state-path descriptor is valid. */\nexport function isExactContinuationStatePath(\n\tvalue: unknown\n): value is ExactContinuationStatePathContract {\n\treturn (\n\t\tisContractRecord(value) &&\n\t\thasOnlyContractKeys(value, ['path', 'kind', 'confidence', 'operation']) &&\n\t\tisContractString(value.path) &&\n\t\t(value.kind === 'read' || value.kind === 'write') &&\n\t\t(value.confidence === 'exact' ||\n\t\t\tvalue.confidence === 'broad' ||\n\t\t\tvalue.confidence === 'unknown') &&\n\t\t(value.operation === undefined ||\n\t\t\tvalue.operation === 'value' ||\n\t\t\tvalue.operation === 'map' ||\n\t\t\tvalue.operation === 'set')\n\t);\n}\n\n/** Validates readable attribution and opaque identity for a compiled progress receiver. */\nexport function isExactProgressReceiver(\n\tvalue: unknown\n): value is Readonly<{ id: string; label: string }> {\n\treturn (\n\t\tisContractRecord(value) &&\n\t\thasOnlyContractKeys(value, ['id', 'label']) &&\n\t\tisContractString(value.id) &&\n\t\tisContractString(value.label)\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"contract-validation.d.ts","sourceRoot":"","sources":["../../src/component-contract/contract-validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,sBAAsB,EAKtB,MAAM,2BAA2B,CAAC;AAsBnC,2FAA2F;AAC3F,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM,GACjB,KAAK,IAAI,sBAAsB,CA0CjC"}
1
+ {"version":3,"file":"contract-validation.d.ts","sourceRoot":"","sources":["../../src/component-contract/contract-validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,sBAAsB,EAKtB,MAAM,2BAA2B,CAAC;AAuBnC,2FAA2F;AAC3F,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM,GACjB,KAAK,IAAI,sBAAsB,CA0CjC"}
@@ -1,7 +1,7 @@
1
1
  import { componentContractVersion } from '../component/contract-versions.js';
2
2
  import { hasConsistentStatelessServerExecution, isExactServerExecutionMetadata } from './server-execution-validation.js';
3
3
  import { isExactComponentBoundaryContract } from './boundary-validation.js';
4
- import { isExactContinuationDependency, isExactContinuationInvocation, isExactContinuationStatePath } from './continuation-validation.js';
4
+ import { isExactProgressReceiver, isExactContinuationDependency, isExactContinuationInvocation, isExactContinuationStatePath } from './continuation-validation.js';
5
5
  import { hasOnlyContractKeys, isContractRecord, isContractString, isReactiveAllocation, isSafeContractStringList, isSafeContractPropertyKeyList } from './metadata-validation.js';
6
6
  import { allCompiledComponentABI } from '../component/compiled-abi.js';
7
7
  import { isExactValueSerializationSchema } from '../component-abi/value-serialization.js';
@@ -211,6 +211,7 @@ function isContinuation(value) {
211
211
  'componentId',
212
212
  'readiness',
213
213
  'concurrency',
214
+ 'progress',
214
215
  'dependencies',
215
216
  'stateReads',
216
217
  'stateWrites',
@@ -226,6 +227,8 @@ function isContinuation(value) {
226
227
  isContractString(value.componentId) &&
227
228
  (value.readiness === 'blocking' || value.readiness === 'nonblocking') &&
228
229
  (value.concurrency === undefined || isConcurrency(value.concurrency)) &&
230
+ (value.progress === undefined ||
231
+ (Array.isArray(value.progress) && value.progress.every(isExactProgressReceiver))) &&
229
232
  Array.isArray(value.dependencies) &&
230
233
  value.dependencies.every(isExactContinuationDependency) &&
231
234
  Array.isArray(value.stateReads) &&