@pulsarinteractive/geniustasker 0.1.0-beta.13 → 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.
Files changed (44) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +5 -1
  3. package/docs/CHATGPT.md +17 -0
  4. package/docs/CLI.md +46 -1
  5. package/docs/FEEDBACK.md +96 -0
  6. package/docs/INTEGRATIONS.md +4 -4
  7. package/docs/PLANNING.md +149 -10
  8. package/docs/TASK_CHECKLISTS.md +85 -0
  9. package/docs/TASK_LOCKS.md +99 -0
  10. package/docs/TASK_PAUSES.md +91 -0
  11. package/examples/codex.toml +1 -1
  12. package/examples/mcp.json +1 -1
  13. package/mcp.json +1 -1
  14. package/package.json +1 -1
  15. package/plugin.json +1 -1
  16. package/remote/tool-catalog.json +735 -2
  17. package/remote/workflows.json +62 -6
  18. package/skills/geniustasker/SKILL.md +37 -0
  19. package/skills/geniustasker/references/agent-runs.md +33 -2
  20. package/skills/geniustasker/references/collaboration.md +15 -2
  21. package/skills/geniustasker/references/host-events.md +9 -0
  22. package/skills/geniustasker/references/incremental-reads.md +11 -0
  23. package/skills/geniustasker/references/protocols.md +29 -3
  24. package/skills/geniustasker-feedback/SKILL.md +44 -0
  25. package/skills/geniustasker-feedback/agents/openai.yaml +4 -0
  26. package/skills/geniustasker-planning/SKILL.md +48 -0
  27. package/src/changes.mjs +5 -1
  28. package/src/cli.mjs +134 -7
  29. package/src/client.mjs +16 -0
  30. package/src/command-catalog.mjs +156 -1
  31. package/src/command-input-schemas.mjs +924 -0
  32. package/src/commands.mjs +250 -20
  33. package/src/feedback-contract.mjs +629 -0
  34. package/src/feedback-image.mjs +123 -0
  35. package/src/feedback-media-transfer.mjs +61 -0
  36. package/src/feedback.mjs +152 -0
  37. package/src/intents.mjs +111 -0
  38. package/src/mcp.mjs +126 -3
  39. package/src/protocols.mjs +1 -0
  40. package/src/resources.mjs +26 -3
  41. package/src/task-availability-contract.mjs +166 -0
  42. package/src/task-availability.mjs +35 -0
  43. package/src/task-state-legacy-contract.mjs +121 -0
  44. package/src/transport.mjs +10 -3
package/src/resources.mjs CHANGED
@@ -1,5 +1,12 @@
1
1
  import * as z from 'zod/v4';
2
2
  import { fail } from './errors.mjs';
3
+ import { validTaskAvailabilityPage } from './task-availability.mjs';
4
+
5
+ export const taskStateSchema = z
6
+ .enum(['v1', 'v2'])
7
+ .describe(
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
+ );
3
10
 
4
11
  export const resourceScopeSchema = z
5
12
  .string()
@@ -14,12 +21,14 @@ export const resourceReadSchema = z
14
21
  epoch: z.string().max(4096).optional(),
15
22
  checkpoint: z.string().max(4096).optional(),
16
23
  id: z.string().min(1).max(128).optional(),
24
+ taskId: z.string().min(1).max(128).optional(),
17
25
  metricId: z
18
26
  .string()
19
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}$/)
20
28
  .optional(),
21
29
  path: z.string().min(1).max(512).optional(),
22
30
  archive: z.enum(['active', 'archived', 'all']).optional(),
31
+ taskState: taskStateSchema.optional(),
23
32
  })
24
33
  .strict();
25
34
  export const projectMetricCollections = [
@@ -42,7 +51,7 @@ export const metricHistoryCollections = [
42
51
  'personalMetricCorrections',
43
52
  ];
44
53
  export const metricReadSchema = resourceReadSchema
45
- .omit({ path: true })
54
+ .omit({ path: true, taskState: true, taskId: true })
46
55
  .extend({
47
56
  collection: z.enum(metricCollections),
48
57
  })
@@ -50,7 +59,13 @@ export const metricReadSchema = resourceReadSchema
50
59
 
51
60
  /** Personal access is an explicit metric surface, never a generic account read.
52
61
  * Current owner, grant and project rights are always checked by the server. */
53
- export function validateResourceScope({ scope, collection, metricId }) {
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
+ }
66
+ if (taskState !== undefined && collection !== 'tasks') {
67
+ fail('invalid_arguments', 'taskState is available only for the tasks collection.');
68
+ }
54
69
  if (
55
70
  (scope.startsWith('personal:') && !personalMetricCollections.includes(collection)) ||
56
71
  (personalMetricCollections.includes(collection) && !scope.startsWith('personal:')) ||
@@ -78,13 +93,21 @@ export async function readResources(client, input) {
78
93
  }
79
94
  const requested = parsed.data;
80
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
+ }
81
99
  if (requested.after && (!requested.epoch || !requested.checkpoint)) {
82
100
  fail(
83
101
  'invalid_arguments',
84
102
  'Continuation requires the unchanged epoch and checkpoint returned with the first page.',
85
103
  );
86
104
  }
87
- return client.get('resources', requested);
105
+ const result = await client.get('resources', requested);
106
+ if (!validTaskAvailabilityPage(result, requested.collection, requested.taskState)) {
107
+ client.invalidateReads?.();
108
+ fail('invalid_response', 'The task availability snapshot was invalid; read the task again.');
109
+ }
110
+ return result;
88
111
  }
89
112
  export async function readMetrics(client, input) {
90
113
  const parsed = metricReadSchema.safeParse(input);
@@ -0,0 +1,166 @@
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
+ "pauseNextSteps",
11
+ "pauseReason",
12
+ "pausedAt",
13
+ "progress",
14
+ "source",
15
+ "status"
16
+ ],
17
+ "properties": {
18
+ "blockersTruncated": {
19
+ "type": "boolean"
20
+ },
21
+ "blockingIds": {
22
+ "type": "array",
23
+ "maxItems": 20,
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "dependencyCount": {
29
+ "type": "integer",
30
+ "minimum": 0,
31
+ "maximum": 1000
32
+ },
33
+ "incomplete": {
34
+ "type": "boolean"
35
+ },
36
+ "manualReason": {
37
+ "anyOf": [
38
+ {
39
+ "type": "string"
40
+ },
41
+ {
42
+ "type": "null"
43
+ }
44
+ ]
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
+ },
76
+ "progress": {
77
+ "oneOf": [
78
+ {
79
+ "type": "string",
80
+ "enum": [
81
+ "New"
82
+ ]
83
+ },
84
+ {
85
+ "type": "string",
86
+ "enum": [
87
+ "InProgress"
88
+ ]
89
+ },
90
+ {
91
+ "type": "string",
92
+ "enum": [
93
+ "Paused"
94
+ ]
95
+ },
96
+ {
97
+ "type": "string",
98
+ "enum": [
99
+ "Done"
100
+ ]
101
+ }
102
+ ]
103
+ },
104
+ "source": {
105
+ "type": "object",
106
+ "required": [
107
+ "authorizationEpoch",
108
+ "epoch",
109
+ "head"
110
+ ],
111
+ "properties": {
112
+ "authorizationEpoch": {
113
+ "type": "string"
114
+ },
115
+ "epoch": {
116
+ "type": "string"
117
+ },
118
+ "head": {
119
+ "type": "string"
120
+ }
121
+ },
122
+ "additionalProperties": false
123
+ },
124
+ "status": {
125
+ "oneOf": [
126
+ {
127
+ "type": "string",
128
+ "enum": [
129
+ "New"
130
+ ]
131
+ },
132
+ {
133
+ "type": "string",
134
+ "enum": [
135
+ "InProgress"
136
+ ]
137
+ },
138
+ {
139
+ "type": "string",
140
+ "enum": [
141
+ "Paused"
142
+ ]
143
+ },
144
+ {
145
+ "type": "string",
146
+ "enum": [
147
+ "Done"
148
+ ]
149
+ },
150
+ {
151
+ "type": "string",
152
+ "enum": [
153
+ "Locked"
154
+ ]
155
+ },
156
+ {
157
+ "type": "string",
158
+ "enum": [
159
+ "Unknown"
160
+ ]
161
+ }
162
+ ]
163
+ }
164
+ },
165
+ "additionalProperties": false
166
+ };
@@ -0,0 +1,35 @@
1
+ import * as z from 'zod/v4';
2
+ import contract from './task-availability-contract.mjs';
3
+ import legacyContract from './task-state-legacy-contract.mjs';
4
+
5
+ export const taskAvailabilityV1Schema = z.fromJSONSchema(legacyContract);
6
+ export const taskAvailabilityV2Schema = z.fromJSONSchema(contract);
7
+ export const taskAvailabilitySchema = z.union([taskAvailabilityV1Schema, taskAvailabilityV2Schema]);
8
+
9
+ /** Validate only the optional projection. Its head belongs to the current task
10
+ * module, not necessarily the page's historical checkpoint or the row revision.
11
+ * Legacy absence is retained; it must never become an invented unlocked state. */
12
+ export function validTaskAvailabilityPage(page, collection, taskState) {
13
+ if (!Array.isArray(page?.items)) {
14
+ return true;
15
+ }
16
+ const schema =
17
+ taskState === 'v2'
18
+ ? taskAvailabilityV2Schema
19
+ : taskState === 'v1'
20
+ ? taskAvailabilityV1Schema
21
+ : null;
22
+ return page.items.every((item) => {
23
+ if (!item || !Object.hasOwn(item, 'taskAvailability')) {
24
+ return true;
25
+ }
26
+ return (
27
+ collection === 'tasks' &&
28
+ schema !== null &&
29
+ item.kind !== 'remove' &&
30
+ !(taskState === 'v1' && item.data?.status === 'Paused') &&
31
+ schema.safeParse(item.taskAvailability).success &&
32
+ item.taskAvailability.source.epoch === page.epoch
33
+ );
34
+ });
35
+ }
@@ -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
+ };
package/src/transport.mjs CHANGED
@@ -80,10 +80,17 @@ export class Transport {
80
80
  }
81
81
  }
82
82
  }
83
+ const feedbackMedia =
84
+ /^\/api\/agents\/v1\/feedback\/media\/[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}\/content$/.test(
85
+ url.pathname,
86
+ );
83
87
  if (
84
88
  (bytes !== undefined || binary) &&
85
- (url.pathname !== '/api/agents/v1/media/content' ||
86
- (bytes !== undefined && (!Buffer.isBuffer(bytes) || bytes.length > 15000000)) ||
89
+ ((!feedbackMedia && url.pathname !== '/api/agents/v1/media/content') ||
90
+ (feedbackMedia &&
91
+ (url.search || (bytes !== undefined ? method !== 'PUT' : method !== 'GET'))) ||
92
+ (bytes !== undefined &&
93
+ (!Buffer.isBuffer(bytes) || bytes.length > (feedbackMedia ? 4_000_000 : 15_000_000))) ||
87
94
  (bytes !== undefined && (json !== undefined || form)))
88
95
  ) {
89
96
  fail('invalid_arguments', 'Binary transfer requires the bounded delegated media endpoint.');
@@ -144,7 +151,7 @@ export class Transport {
144
151
  if (response.body) {
145
152
  for await (const chunk of response.body) {
146
153
  size += chunk.length;
147
- if (size > (binary && response.ok ? 15000000 : 262144)) {
154
+ if (size > (binary && response.ok ? (feedbackMedia ? 1_000_000 : 15_000_000) : 262144)) {
148
155
  fail('invalid_response', 'The API response exceeded the size limit.');
149
156
  }
150
157
  chunks.push(chunk);