@questionbase/deskfree 0.3.0-alpha.30 → 0.3.0-alpha.31

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.
package/dist/index.d.ts CHANGED
@@ -668,6 +668,17 @@ declare class DeskFreeClient {
668
668
  taskId: string;
669
669
  reason?: string;
670
670
  }): Promise<Task>;
671
+ /** Snooze a task until a specified time. Task is hidden from active queues until then. */
672
+ snoozeTask(input: {
673
+ taskId: string;
674
+ scheduledFor: string;
675
+ initiator: 'human_request' | 'bot_decision';
676
+ reason: string;
677
+ }): Promise<Task>;
678
+ /** Unsnooze a task, making it immediately active before the snooze expires. */
679
+ unsnoozeTask(input: {
680
+ taskId: string;
681
+ }): Promise<Task>;
671
682
  /** Propose a plan — creates a proposal message with plan metadata. No DB rows until human approves. */
672
683
  proposePlan(input: {
673
684
  tasks: Array<{
package/dist/index.js CHANGED
@@ -3942,6 +3942,18 @@ var DeskFreeClient = class {
3942
3942
  this.requireNonEmpty(input.taskId, "taskId");
3943
3943
  return this.request("POST", "tasks.reopen", input);
3944
3944
  }
3945
+ /** Snooze a task until a specified time. Task is hidden from active queues until then. */
3946
+ async snoozeTask(input) {
3947
+ this.requireNonEmpty(input.taskId, "taskId");
3948
+ this.requireNonEmpty(input.scheduledFor, "scheduledFor");
3949
+ this.requireNonEmpty(input.reason, "reason");
3950
+ return this.request("POST", "tasks.snooze", input);
3951
+ }
3952
+ /** Unsnooze a task, making it immediately active before the snooze expires. */
3953
+ async unsnoozeTask(input) {
3954
+ this.requireNonEmpty(input.taskId, "taskId");
3955
+ return this.request("POST", "tasks.unsnooze", input);
3956
+ }
3945
3957
  /** Propose a plan — creates a proposal message with plan metadata. No DB rows until human approves. */
3946
3958
  async proposePlan(input) {
3947
3959
  if (!input.tasks || input.tasks.length === 0) {
@@ -7944,6 +7956,19 @@ var ORCHESTRATOR_TOOLS = {
7944
7956
  description: "Get full workspace state \u2014 all tasks, recently done tasks, active initiatives. Use to assess what needs attention.",
7945
7957
  parameters: Type.Object({})
7946
7958
  },
7959
+ SCHEDULE_TASK: {
7960
+ name: "deskfree_schedule_task",
7961
+ description: "Schedule or reschedule a task. Pass a future ISO datetime to defer the task until that time. Pass null to activate it immediately. Use when the human asks to defer, park, or reschedule a task.",
7962
+ parameters: Type.Object({
7963
+ taskId: Type.String({ description: "Task UUID to schedule" }),
7964
+ scheduledFor: Type.Union([Type.String(), Type.Null()], {
7965
+ description: "ISO 8601 datetime for when the task should activate. Pass null to activate immediately."
7966
+ }),
7967
+ reason: Type.String({
7968
+ description: "Brief explanation (shown in task thread)"
7969
+ })
7970
+ })
7971
+ },
7947
7972
  REOPEN_TASK: {
7948
7973
  name: "deskfree_reopen_task",
7949
7974
  description: "Reopen a completed or human-side task back to bot status. Use when a human message in a task thread indicates more work is needed. The task becomes available for a worker to claim.",
@@ -9276,6 +9301,41 @@ function createOrchestratorTools(api) {
9276
9301
  }
9277
9302
  }
9278
9303
  },
9304
+ {
9305
+ ...ORCHESTRATOR_TOOLS.SCHEDULE_TASK,
9306
+ async execute(_id, params) {
9307
+ try {
9308
+ const taskId = validateStringParam(params, "taskId", true);
9309
+ const scheduledFor = params?.scheduledFor;
9310
+ const reason = validateStringParam(params, "reason", true);
9311
+ if (scheduledFor) {
9312
+ const result = await client.snoozeTask({
9313
+ taskId,
9314
+ scheduledFor,
9315
+ initiator: "human_request",
9316
+ reason
9317
+ });
9318
+ return formatTaskResponse(
9319
+ result,
9320
+ `Task "${result.title}" scheduled for ${new Date(scheduledFor).toLocaleString()}`,
9321
+ [
9322
+ `Reason: ${reason}`,
9323
+ "Task will resurface automatically at the scheduled time"
9324
+ ]
9325
+ );
9326
+ } else {
9327
+ const result = await client.unsnoozeTask({ taskId });
9328
+ return formatTaskResponse(
9329
+ result,
9330
+ `Task "${result.title}" activated immediately`,
9331
+ ["Task is now available in the active queue"]
9332
+ );
9333
+ }
9334
+ } catch (err) {
9335
+ return errorResult(err);
9336
+ }
9337
+ }
9338
+ },
9279
9339
  {
9280
9340
  ...ORCHESTRATOR_TOOLS.REOPEN_TASK,
9281
9341
  execute: makeReopenTaskHandler(client)