@pulsarinteractive/geniustasker 0.1.0-beta.14 → 0.1.0-beta.15
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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/docs/CHATGPT.md +17 -0
- package/docs/CLI.md +24 -9
- package/docs/INTEGRATIONS.md +4 -4
- package/docs/PLANNING.md +62 -18
- package/docs/TASK_CHECKLISTS.md +85 -0
- package/docs/TASK_LOCKS.md +18 -10
- package/docs/TASK_PAUSES.md +91 -0
- package/examples/codex.toml +1 -1
- package/examples/mcp.json +1 -1
- package/mcp.json +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/remote/tool-catalog.json +145 -6
- package/remote/workflows.json +31 -9
- package/skills/geniustasker/SKILL.md +20 -2
- package/skills/geniustasker/references/agent-runs.md +23 -5
- package/skills/geniustasker/references/collaboration.md +15 -2
- package/skills/geniustasker/references/host-events.md +9 -0
- package/skills/geniustasker/references/incremental-reads.md +4 -2
- package/skills/geniustasker/references/protocols.md +13 -2
- package/skills/geniustasker-planning/SKILL.md +24 -4
- package/src/cli.mjs +8 -1
- package/src/command-catalog.mjs +101 -0
- package/src/command-input-schemas.mjs +316 -2
- package/src/commands.mjs +13 -1
- package/src/mcp.mjs +2 -2
- package/src/resources.mjs +11 -4
- package/src/task-availability-contract.mjs +45 -0
- package/src/task-availability.mjs +13 -3
- package/src/task-state-legacy-contract.mjs +121 -0
package/src/resources.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import { fail } from './errors.mjs';
|
|
|
3
3
|
import { validTaskAvailabilityPage } from './task-availability.mjs';
|
|
4
4
|
|
|
5
5
|
export const taskStateSchema = z
|
|
6
|
-
.
|
|
6
|
+
.enum(['v1', 'v2'])
|
|
7
7
|
.describe(
|
|
8
|
-
'Explicit opt-in
|
|
8
|
+
'Explicit task-only opt-in after discovery: choose v2 when capabilities.collections[id=tasks].taskStateVersions includes v2, otherwise v1 only when taskState advertises v1. Omit on older deployments. A missing snapshot never means available; v1 omits snapshots for Paused tasks.',
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
export const resourceScopeSchema = z
|
|
@@ -21,6 +21,7 @@ export const resourceReadSchema = z
|
|
|
21
21
|
epoch: z.string().max(4096).optional(),
|
|
22
22
|
checkpoint: z.string().max(4096).optional(),
|
|
23
23
|
id: z.string().min(1).max(128).optional(),
|
|
24
|
+
taskId: z.string().min(1).max(128).optional(),
|
|
24
25
|
metricId: z
|
|
25
26
|
.string()
|
|
26
27
|
.regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/)
|
|
@@ -50,7 +51,7 @@ export const metricHistoryCollections = [
|
|
|
50
51
|
'personalMetricCorrections',
|
|
51
52
|
];
|
|
52
53
|
export const metricReadSchema = resourceReadSchema
|
|
53
|
-
.omit({ path: true, taskState: true })
|
|
54
|
+
.omit({ path: true, taskState: true, taskId: true })
|
|
54
55
|
.extend({
|
|
55
56
|
collection: z.enum(metricCollections),
|
|
56
57
|
})
|
|
@@ -58,7 +59,10 @@ export const metricReadSchema = resourceReadSchema
|
|
|
58
59
|
|
|
59
60
|
/** Personal access is an explicit metric surface, never a generic account read.
|
|
60
61
|
* Current owner, grant and project rights are always checked by the server. */
|
|
61
|
-
export function validateResourceScope({ scope, collection, metricId, taskState }) {
|
|
62
|
+
export function validateResourceScope({ scope, collection, metricId, taskState, taskId }) {
|
|
63
|
+
if (taskId !== undefined && collection !== 'checklist') {
|
|
64
|
+
fail('invalid_arguments', 'taskId filters the checklist collection only.');
|
|
65
|
+
}
|
|
62
66
|
if (taskState !== undefined && collection !== 'tasks') {
|
|
63
67
|
fail('invalid_arguments', 'taskState is available only for the tasks collection.');
|
|
64
68
|
}
|
|
@@ -89,6 +93,9 @@ export async function readResources(client, input) {
|
|
|
89
93
|
}
|
|
90
94
|
const requested = parsed.data;
|
|
91
95
|
validateResourceScope(requested);
|
|
96
|
+
if (requested.collection === 'checklist' && !requested.taskId && !requested.id) {
|
|
97
|
+
fail('invalid_arguments', 'Read a checklist with its taskId or one exact item id.');
|
|
98
|
+
}
|
|
92
99
|
if (requested.after && (!requested.epoch || !requested.checkpoint)) {
|
|
93
100
|
fail(
|
|
94
101
|
'invalid_arguments',
|
|
@@ -7,6 +7,9 @@ export default {
|
|
|
7
7
|
"dependencyCount",
|
|
8
8
|
"incomplete",
|
|
9
9
|
"manualReason",
|
|
10
|
+
"pauseNextSteps",
|
|
11
|
+
"pauseReason",
|
|
12
|
+
"pausedAt",
|
|
10
13
|
"progress",
|
|
11
14
|
"source",
|
|
12
15
|
"status"
|
|
@@ -40,6 +43,36 @@ export default {
|
|
|
40
43
|
}
|
|
41
44
|
]
|
|
42
45
|
},
|
|
46
|
+
"pauseNextSteps": {
|
|
47
|
+
"anyOf": [
|
|
48
|
+
{
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "null"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"pauseReason": {
|
|
57
|
+
"anyOf": [
|
|
58
|
+
{
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "null"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"pausedAt": {
|
|
67
|
+
"anyOf": [
|
|
68
|
+
{
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "null"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
43
76
|
"progress": {
|
|
44
77
|
"oneOf": [
|
|
45
78
|
{
|
|
@@ -54,6 +87,12 @@ export default {
|
|
|
54
87
|
"InProgress"
|
|
55
88
|
]
|
|
56
89
|
},
|
|
90
|
+
{
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": [
|
|
93
|
+
"Paused"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
57
96
|
{
|
|
58
97
|
"type": "string",
|
|
59
98
|
"enum": [
|
|
@@ -96,6 +135,12 @@ export default {
|
|
|
96
135
|
"InProgress"
|
|
97
136
|
]
|
|
98
137
|
},
|
|
138
|
+
{
|
|
139
|
+
"type": "string",
|
|
140
|
+
"enum": [
|
|
141
|
+
"Paused"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
99
144
|
{
|
|
100
145
|
"type": "string",
|
|
101
146
|
"enum": [
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as z from 'zod/v4';
|
|
2
2
|
import contract from './task-availability-contract.mjs';
|
|
3
|
+
import legacyContract from './task-state-legacy-contract.mjs';
|
|
3
4
|
|
|
4
|
-
export const
|
|
5
|
+
export const taskAvailabilityV1Schema = z.fromJSONSchema(legacyContract);
|
|
6
|
+
export const taskAvailabilityV2Schema = z.fromJSONSchema(contract);
|
|
7
|
+
export const taskAvailabilitySchema = z.union([taskAvailabilityV1Schema, taskAvailabilityV2Schema]);
|
|
5
8
|
|
|
6
9
|
/** Validate only the optional projection. Its head belongs to the current task
|
|
7
10
|
* module, not necessarily the page's historical checkpoint or the row revision.
|
|
@@ -10,15 +13,22 @@ export function validTaskAvailabilityPage(page, collection, taskState) {
|
|
|
10
13
|
if (!Array.isArray(page?.items)) {
|
|
11
14
|
return true;
|
|
12
15
|
}
|
|
16
|
+
const schema =
|
|
17
|
+
taskState === 'v2'
|
|
18
|
+
? taskAvailabilityV2Schema
|
|
19
|
+
: taskState === 'v1'
|
|
20
|
+
? taskAvailabilityV1Schema
|
|
21
|
+
: null;
|
|
13
22
|
return page.items.every((item) => {
|
|
14
23
|
if (!item || !Object.hasOwn(item, 'taskAvailability')) {
|
|
15
24
|
return true;
|
|
16
25
|
}
|
|
17
26
|
return (
|
|
18
27
|
collection === 'tasks' &&
|
|
19
|
-
|
|
28
|
+
schema !== null &&
|
|
20
29
|
item.kind !== 'remove' &&
|
|
21
|
-
|
|
30
|
+
!(taskState === 'v1' && item.data?.status === 'Paused') &&
|
|
31
|
+
schema.safeParse(item.taskAvailability).success &&
|
|
22
32
|
item.taskAvailability.source.epoch === page.epoch
|
|
23
33
|
);
|
|
24
34
|
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Generated public task availability schema. Do not edit by hand.
|
|
2
|
+
export default {
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"blockersTruncated",
|
|
6
|
+
"blockingIds",
|
|
7
|
+
"dependencyCount",
|
|
8
|
+
"incomplete",
|
|
9
|
+
"manualReason",
|
|
10
|
+
"progress",
|
|
11
|
+
"source",
|
|
12
|
+
"status"
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"blockersTruncated": {
|
|
16
|
+
"type": "boolean"
|
|
17
|
+
},
|
|
18
|
+
"blockingIds": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"maxItems": 20,
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dependencyCount": {
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"minimum": 0,
|
|
28
|
+
"maximum": 1000
|
|
29
|
+
},
|
|
30
|
+
"incomplete": {
|
|
31
|
+
"type": "boolean"
|
|
32
|
+
},
|
|
33
|
+
"manualReason": {
|
|
34
|
+
"anyOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "null"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"progress": {
|
|
44
|
+
"oneOf": [
|
|
45
|
+
{
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": [
|
|
48
|
+
"New"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "string",
|
|
53
|
+
"enum": [
|
|
54
|
+
"InProgress"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "string",
|
|
59
|
+
"enum": [
|
|
60
|
+
"Done"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"source": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"required": [
|
|
68
|
+
"authorizationEpoch",
|
|
69
|
+
"epoch",
|
|
70
|
+
"head"
|
|
71
|
+
],
|
|
72
|
+
"properties": {
|
|
73
|
+
"authorizationEpoch": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
},
|
|
76
|
+
"epoch": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"head": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"additionalProperties": false
|
|
84
|
+
},
|
|
85
|
+
"status": {
|
|
86
|
+
"oneOf": [
|
|
87
|
+
{
|
|
88
|
+
"type": "string",
|
|
89
|
+
"enum": [
|
|
90
|
+
"New"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "string",
|
|
95
|
+
"enum": [
|
|
96
|
+
"InProgress"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "string",
|
|
101
|
+
"enum": [
|
|
102
|
+
"Done"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "string",
|
|
107
|
+
"enum": [
|
|
108
|
+
"Locked"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"type": "string",
|
|
113
|
+
"enum": [
|
|
114
|
+
"Unknown"
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"additionalProperties": false
|
|
121
|
+
};
|