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

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.",
@@ -7996,7 +8021,7 @@ var ORCHESTRATOR_TOOLS = {
7996
8021
  },
7997
8022
  PROPOSE: {
7998
8023
  name: "deskfree_propose",
7999
- description: "Propose a plan for human approval. Nothing is created until the human reviews and approves in a modal. One initiative per call \u2014 make multiple calls for multiple initiatives. Include substeps as human-reviewable checklist items.",
8024
+ description: "Propose a plan for human approval. Nothing is created until the human reviews and approves in a modal. One initiative per call \u2014 make multiple calls for multiple initiatives. Put all steps and details in the instructions field using simple markdown (bold, lists, inline code). Do NOT use markdown headers (#) \u2014 use **bold text** instead for section labels.",
8000
8025
  parameters: Type.Object({
8001
8026
  initiative: Type.Optional(
8002
8027
  Type.Union(
@@ -8035,12 +8060,12 @@ var ORCHESTRATOR_TOOLS = {
8035
8060
  }),
8036
8061
  instructions: Type.Optional(
8037
8062
  Type.String({
8038
- description: "Detailed instructions: what to do, why, what done looks like, known constraints"
8063
+ description: "Detailed instructions in simple markdown (bold, lists, inline code \u2014 no # headers). Include: what to do, steps, why, what done looks like, known constraints."
8039
8064
  })
8040
8065
  ),
8041
8066
  substeps: Type.Optional(
8042
8067
  Type.Array(Type.String(), {
8043
- description: "Human-reviewable checklist items. The human can toggle each on/off before approving. Use for discrete steps within the task.",
8068
+ description: "DEPRECATED \u2014 put steps in the instructions field as markdown instead. This field is ignored.",
8044
8069
  minItems: 1,
8045
8070
  maxItems: 20
8046
8071
  })
@@ -8159,7 +8184,7 @@ var SHARED_TOOLS = {
8159
8184
  },
8160
8185
  PROPOSE: {
8161
8186
  name: "deskfree_propose",
8162
- description: "Propose a plan for human approval. Nothing is created until the human reviews and approves in a modal. One initiative per call \u2014 make multiple calls for multiple initiatives. Include substeps as human-reviewable checklist items.",
8187
+ description: "Propose a plan for human approval. Nothing is created until the human reviews and approves in a modal. One initiative per call \u2014 make multiple calls for multiple initiatives. Put all steps and details in the instructions field using simple markdown (bold, lists, inline code). Do NOT use markdown headers (#) \u2014 use **bold text** instead for section labels.",
8163
8188
  parameters: Type.Object({
8164
8189
  initiative: Type.Optional(
8165
8190
  Type.Union(
@@ -8198,12 +8223,12 @@ var SHARED_TOOLS = {
8198
8223
  }),
8199
8224
  instructions: Type.Optional(
8200
8225
  Type.String({
8201
- description: "Detailed instructions: what to do, why, what done looks like, known constraints"
8226
+ description: "Detailed instructions in simple markdown (bold, lists, inline code \u2014 no # headers). Include: what to do, steps, why, what done looks like, known constraints."
8202
8227
  })
8203
8228
  ),
8204
8229
  substeps: Type.Optional(
8205
8230
  Type.Array(Type.String(), {
8206
- description: "Human-reviewable checklist items. The human can toggle each on/off before approving. Use for discrete steps within the task.",
8231
+ description: "DEPRECATED \u2014 put steps in the instructions field as markdown instead. This field is ignored.",
8207
8232
  minItems: 1,
8208
8233
  maxItems: 20
8209
8234
  })
@@ -8854,7 +8879,7 @@ You are the orchestrator. Your job: turn human intent into approved tasks, then
8854
8879
 
8855
8880
  You do NOT claim tasks or do work directly. Sub-agents handle execution.
8856
8881
  - When a human writes in a task thread, you receive it with recent context. Use \`deskfree_reopen_task\` if it needs more work.
8857
- - Write task instructions as if briefing a contractor who has never seen the codebase.
8882
+ - Write task instructions as rich markdown (bold, lists, inline code \u2014 no # headers). Brief a contractor who has never seen the codebase.
8858
8883
  - Estimate token cost per task \u2014 consider files to read, reasoning, output.
8859
8884
  - One initiative per proposal \u2014 make multiple calls for multiple initiatives.`;
8860
8885
  var DESKFREE_WORKER_DIRECTIVE = `## DeskFree Worker
@@ -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)