@perspectask/sdk 0.0.3 → 0.0.4
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/README.md +5 -0
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,8 +67,13 @@ const { data: tasks } = await pt.tasks.list({ includeEncrypted: true });
|
|
|
67
67
|
// relative time ("5 minutes ago"); showCreatedDate returns an ISO timestamp.
|
|
68
68
|
const { data: tasks } = await pt.tasks.list({ showCreated: true });
|
|
69
69
|
const { data: tasks } = await pt.tasks.list({ showCreatedDate: true });
|
|
70
|
+
|
|
71
|
+
// Include done tasks (COMPLETED + CANCELLED). They're omitted by default.
|
|
72
|
+
const { data: tasks } = await pt.tasks.list({ showCompleted: true });
|
|
70
73
|
```
|
|
71
74
|
|
|
75
|
+
**Done tasks are hidden by default.** `list()` returns only open tasks — `COMPLETED` and `CANCELLED` are omitted so responses stay focused and you spend fewer tokens/context. Pass `showCompleted: true` to include them (they come back at the end).
|
|
76
|
+
|
|
72
77
|
The examples below all use the same three tasks so you can see how the format changes:
|
|
73
78
|
|
|
74
79
|
- `abc` — "Launch v2" (parent, has two children)
|
package/dist/index.d.cts
CHANGED
|
@@ -331,7 +331,7 @@ type Task = {
|
|
|
331
331
|
* The actual end-of-period timestamp (e.g. Sunday 23:59:59 for a weekly task). Omitted for lifetime tasks and tasks without a schedule.
|
|
332
332
|
*/
|
|
333
333
|
deadline_date?: string;
|
|
334
|
-
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING';
|
|
334
|
+
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING' | 'DELEGATED';
|
|
335
335
|
/**
|
|
336
336
|
* Percentage complete (e.g. "52%"), computed recursively over the ENTIRE subtree — children, their children, and so on to the leaves — not just direct children. PerspecTask maintains this automatically so the user sees true progress at a glance. It can read 100% when every descendant is completed even if this task itself is not yet checked. Conversely, if this task is itself marked completed, its completion is forced to 100% regardless of any unfinished descendants (the task-level status overrides the rollup). Only present when the task has children.
|
|
337
337
|
*/
|
|
@@ -353,7 +353,7 @@ type ListTasksData = {
|
|
|
353
353
|
path?: never;
|
|
354
354
|
query?: {
|
|
355
355
|
/**
|
|
356
|
-
* Defaults to false
|
|
356
|
+
* Defaults to false. In tree mode, encrypted tasks are pruned UNLESS they lie on the path to an unencrypted task — so an encrypted parent of a readable task is kept (with `encrypted: true` and no title/description keys) to preserve structure, while fully-encrypted branches are hidden. In flat mode, encrypted tasks are simply omitted. Set to true to include ALL end-to-end-encrypted tasks for full visibility.
|
|
357
357
|
*/
|
|
358
358
|
includeEncrypted?: boolean;
|
|
359
359
|
/**
|
|
@@ -372,6 +372,10 @@ type ListTasksData = {
|
|
|
372
372
|
* Defaults to false. Set to true to include `created` as an absolute ISO 8601 timestamp. Takes precedence over `showCreated` when both are set.
|
|
373
373
|
*/
|
|
374
374
|
showCreatedDate?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Defaults to false. By default the list omits done tasks (status COMPLETED and CANCELLED) so an agent sees only open work and to save context. Set to true to include all completed and cancelled tasks. Exception in tree mode: a completed task is kept if any of its descendants is still open — this preserves the path/context to that open task even when showCompleted is false.
|
|
377
|
+
*/
|
|
378
|
+
showCompleted?: boolean;
|
|
375
379
|
};
|
|
376
380
|
url: '/tasks';
|
|
377
381
|
};
|
|
@@ -417,9 +421,17 @@ type GetTaskData = {
|
|
|
417
421
|
};
|
|
418
422
|
query?: {
|
|
419
423
|
/**
|
|
420
|
-
* Defaults to false.
|
|
424
|
+
* Defaults to false. In tree mode, encrypted descendants are pruned unless they lie on the path to an unencrypted task (so you see the structure leading to a task you can read). Set to true to keep ALL encrypted tasks in the subtree (returned with `encrypted: true` and no title/description keys). The requested task itself is always returned regardless.
|
|
425
|
+
*/
|
|
426
|
+
includeEncrypted?: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Defaults to false. When true, this task's `children` are returned as full nested task objects (recursively) instead of id strings. A task that was already expanded elsewhere in the subtree will not be expanded again — only its short id string will appear in subsequent parents' `children`, preserving the relationship without repeating the full object.
|
|
421
429
|
*/
|
|
422
430
|
tree?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Like `tree` but without deduplication: a task with multiple parents appears under each parent. Mutually exclusive with `tree`.
|
|
433
|
+
*/
|
|
434
|
+
treeFull?: boolean;
|
|
423
435
|
/**
|
|
424
436
|
* Defaults to false. Set to true to include `created` as a human-friendly relative time (e.g. "5 minutes ago"). Ignored when `showCreatedDate` is true.
|
|
425
437
|
*/
|
|
@@ -428,6 +440,10 @@ type GetTaskData = {
|
|
|
428
440
|
* Defaults to false. Set to true to include `created` as an absolute ISO 8601 timestamp. Takes precedence over `showCreated` when both are set.
|
|
429
441
|
*/
|
|
430
442
|
showCreatedDate?: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Defaults to false. By default completed and cancelled subtasks are pruned from the tree. Exception: a completed task is kept if any of its descendants is still open (to preserve context/path). Set to true to include all completed and cancelled tasks regardless.
|
|
445
|
+
*/
|
|
446
|
+
showCompleted?: boolean;
|
|
431
447
|
};
|
|
432
448
|
url: '/tasks/{id}';
|
|
433
449
|
};
|
|
@@ -452,7 +468,7 @@ type UpdateTaskData = {
|
|
|
452
468
|
* When this task is due — same shorthand grammar as on create (today, lifetime, q-2-2026, q2, d-20-11, …).
|
|
453
469
|
*/
|
|
454
470
|
deadline?: string;
|
|
455
|
-
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING';
|
|
471
|
+
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING' | 'DELEGATED';
|
|
456
472
|
priority?: 0 | 1 | 2 | 3;
|
|
457
473
|
/**
|
|
458
474
|
* Attach this task as a child of the given parent (full UUID or short id prefix).
|
|
@@ -470,6 +486,14 @@ type UpdateTaskData = {
|
|
|
470
486
|
* When replacing among multiple parents, the existing parent to replace (full UUID or short id prefix; used with `replace_parent`).
|
|
471
487
|
*/
|
|
472
488
|
replace_parent_from?: string;
|
|
489
|
+
/**
|
|
490
|
+
* Mark the given task as blocking this one — it should be done first (full UUID or short id prefix). Just a flag; nothing is enforced.
|
|
491
|
+
*/
|
|
492
|
+
block?: string;
|
|
493
|
+
/**
|
|
494
|
+
* Remove the given task from this task’s "blocked by" list (full UUID or short id prefix).
|
|
495
|
+
*/
|
|
496
|
+
removeBlock?: string;
|
|
473
497
|
};
|
|
474
498
|
path: {
|
|
475
499
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -331,7 +331,7 @@ type Task = {
|
|
|
331
331
|
* The actual end-of-period timestamp (e.g. Sunday 23:59:59 for a weekly task). Omitted for lifetime tasks and tasks without a schedule.
|
|
332
332
|
*/
|
|
333
333
|
deadline_date?: string;
|
|
334
|
-
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING';
|
|
334
|
+
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING' | 'DELEGATED';
|
|
335
335
|
/**
|
|
336
336
|
* Percentage complete (e.g. "52%"), computed recursively over the ENTIRE subtree — children, their children, and so on to the leaves — not just direct children. PerspecTask maintains this automatically so the user sees true progress at a glance. It can read 100% when every descendant is completed even if this task itself is not yet checked. Conversely, if this task is itself marked completed, its completion is forced to 100% regardless of any unfinished descendants (the task-level status overrides the rollup). Only present when the task has children.
|
|
337
337
|
*/
|
|
@@ -353,7 +353,7 @@ type ListTasksData = {
|
|
|
353
353
|
path?: never;
|
|
354
354
|
query?: {
|
|
355
355
|
/**
|
|
356
|
-
* Defaults to false
|
|
356
|
+
* Defaults to false. In tree mode, encrypted tasks are pruned UNLESS they lie on the path to an unencrypted task — so an encrypted parent of a readable task is kept (with `encrypted: true` and no title/description keys) to preserve structure, while fully-encrypted branches are hidden. In flat mode, encrypted tasks are simply omitted. Set to true to include ALL end-to-end-encrypted tasks for full visibility.
|
|
357
357
|
*/
|
|
358
358
|
includeEncrypted?: boolean;
|
|
359
359
|
/**
|
|
@@ -372,6 +372,10 @@ type ListTasksData = {
|
|
|
372
372
|
* Defaults to false. Set to true to include `created` as an absolute ISO 8601 timestamp. Takes precedence over `showCreated` when both are set.
|
|
373
373
|
*/
|
|
374
374
|
showCreatedDate?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Defaults to false. By default the list omits done tasks (status COMPLETED and CANCELLED) so an agent sees only open work and to save context. Set to true to include all completed and cancelled tasks. Exception in tree mode: a completed task is kept if any of its descendants is still open — this preserves the path/context to that open task even when showCompleted is false.
|
|
377
|
+
*/
|
|
378
|
+
showCompleted?: boolean;
|
|
375
379
|
};
|
|
376
380
|
url: '/tasks';
|
|
377
381
|
};
|
|
@@ -417,9 +421,17 @@ type GetTaskData = {
|
|
|
417
421
|
};
|
|
418
422
|
query?: {
|
|
419
423
|
/**
|
|
420
|
-
* Defaults to false.
|
|
424
|
+
* Defaults to false. In tree mode, encrypted descendants are pruned unless they lie on the path to an unencrypted task (so you see the structure leading to a task you can read). Set to true to keep ALL encrypted tasks in the subtree (returned with `encrypted: true` and no title/description keys). The requested task itself is always returned regardless.
|
|
425
|
+
*/
|
|
426
|
+
includeEncrypted?: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Defaults to false. When true, this task's `children` are returned as full nested task objects (recursively) instead of id strings. A task that was already expanded elsewhere in the subtree will not be expanded again — only its short id string will appear in subsequent parents' `children`, preserving the relationship without repeating the full object.
|
|
421
429
|
*/
|
|
422
430
|
tree?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Like `tree` but without deduplication: a task with multiple parents appears under each parent. Mutually exclusive with `tree`.
|
|
433
|
+
*/
|
|
434
|
+
treeFull?: boolean;
|
|
423
435
|
/**
|
|
424
436
|
* Defaults to false. Set to true to include `created` as a human-friendly relative time (e.g. "5 minutes ago"). Ignored when `showCreatedDate` is true.
|
|
425
437
|
*/
|
|
@@ -428,6 +440,10 @@ type GetTaskData = {
|
|
|
428
440
|
* Defaults to false. Set to true to include `created` as an absolute ISO 8601 timestamp. Takes precedence over `showCreated` when both are set.
|
|
429
441
|
*/
|
|
430
442
|
showCreatedDate?: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Defaults to false. By default completed and cancelled subtasks are pruned from the tree. Exception: a completed task is kept if any of its descendants is still open (to preserve context/path). Set to true to include all completed and cancelled tasks regardless.
|
|
445
|
+
*/
|
|
446
|
+
showCompleted?: boolean;
|
|
431
447
|
};
|
|
432
448
|
url: '/tasks/{id}';
|
|
433
449
|
};
|
|
@@ -452,7 +468,7 @@ type UpdateTaskData = {
|
|
|
452
468
|
* When this task is due — same shorthand grammar as on create (today, lifetime, q-2-2026, q2, d-20-11, …).
|
|
453
469
|
*/
|
|
454
470
|
deadline?: string;
|
|
455
|
-
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING';
|
|
471
|
+
status?: 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'READY' | 'IN_PROGRESS' | 'WAITING' | 'DELEGATED';
|
|
456
472
|
priority?: 0 | 1 | 2 | 3;
|
|
457
473
|
/**
|
|
458
474
|
* Attach this task as a child of the given parent (full UUID or short id prefix).
|
|
@@ -470,6 +486,14 @@ type UpdateTaskData = {
|
|
|
470
486
|
* When replacing among multiple parents, the existing parent to replace (full UUID or short id prefix; used with `replace_parent`).
|
|
471
487
|
*/
|
|
472
488
|
replace_parent_from?: string;
|
|
489
|
+
/**
|
|
490
|
+
* Mark the given task as blocking this one — it should be done first (full UUID or short id prefix). Just a flag; nothing is enforced.
|
|
491
|
+
*/
|
|
492
|
+
block?: string;
|
|
493
|
+
/**
|
|
494
|
+
* Remove the given task from this task’s "blocked by" list (full UUID or short id prefix).
|
|
495
|
+
*/
|
|
496
|
+
removeBlock?: string;
|
|
473
497
|
};
|
|
474
498
|
path: {
|
|
475
499
|
id: string;
|