@pulsarinteractive/geniustasker 0.1.0-beta.12 → 0.1.0-beta.14
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 +20 -0
- package/README.md +12 -1
- package/docs/CHATGPT.md +6 -0
- package/docs/CLI.md +75 -5
- package/docs/FEEDBACK.md +96 -0
- package/docs/INTEGRATIONS.md +25 -2
- package/docs/PLANNING.md +95 -0
- package/docs/TASK_LOCKS.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 +779 -1
- package/remote/workflows.json +56 -2
- package/skills/geniustasker/SKILL.md +29 -1
- package/skills/geniustasker/references/agent-runs.md +13 -0
- package/skills/geniustasker/references/incremental-reads.md +9 -0
- package/skills/geniustasker/references/metric-goals.md +143 -0
- package/skills/geniustasker/references/metrics-observations.md +184 -0
- package/skills/geniustasker/references/metrics.md +136 -0
- package/skills/geniustasker/references/protocols.md +18 -3
- package/skills/geniustasker-feedback/SKILL.md +44 -0
- package/skills/geniustasker-feedback/agents/openai.yaml +4 -0
- package/skills/geniustasker-memory/SKILL.md +4 -1
- package/skills/geniustasker-planning/SKILL.md +28 -0
- package/src/changes.mjs +7 -5
- package/src/cli.mjs +165 -16
- package/src/client.mjs +16 -0
- package/src/command-catalog.mjs +151 -1
- package/src/command-input-schemas.mjs +1254 -93
- package/src/commands.mjs +257 -22
- package/src/feedback-contract.mjs +629 -0
- package/src/feedback-image.mjs +123 -0
- package/src/feedback-media-transfer.mjs +61 -0
- package/src/feedback.mjs +152 -0
- package/src/intents.mjs +111 -0
- package/src/mcp.mjs +143 -20
- package/src/protocols.mjs +1 -0
- package/src/resources.mjs +114 -0
- package/src/task-availability-contract.mjs +121 -0
- package/src/task-availability.mjs +25 -0
- package/src/transport.mjs +10 -3
package/src/protocols.mjs
CHANGED
|
@@ -58,6 +58,7 @@ const step = z.object({
|
|
|
58
58
|
dependencies: z.array(uuid).max(20),
|
|
59
59
|
owner: z.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
60
60
|
dueDate: z.string().max(35).nullable(),
|
|
61
|
+
estimateDays: z.number().min(0.1).max(60).nullable().optional(),
|
|
61
62
|
importance: z.enum(['Minor', 'Normal', 'Important', 'Critical']),
|
|
62
63
|
importanceReason: z.string().max(400),
|
|
63
64
|
delivery,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { fail } from './errors.mjs';
|
|
3
|
+
import { validTaskAvailabilityPage } from './task-availability.mjs';
|
|
4
|
+
|
|
5
|
+
export const taskStateSchema = z
|
|
6
|
+
.literal('v1')
|
|
7
|
+
.describe(
|
|
8
|
+
'Explicit opt-in for tasks only, after capabilities.collections[id=tasks].taskState advertises v1. Omit on older deployments; absence does not mean available.',
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const resourceScopeSchema = z
|
|
12
|
+
.string()
|
|
13
|
+
.max(256)
|
|
14
|
+
// eslint-disable-next-line no-control-regex -- Reject control characters in untrusted input.
|
|
15
|
+
.regex(/^(project|memory|personal):[^\u0000-\u001f]+$/u);
|
|
16
|
+
export const resourceReadSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
scope: resourceScopeSchema,
|
|
19
|
+
collection: z.string().min(1).max(32),
|
|
20
|
+
after: z.string().max(4096).optional(),
|
|
21
|
+
epoch: z.string().max(4096).optional(),
|
|
22
|
+
checkpoint: z.string().max(4096).optional(),
|
|
23
|
+
id: z.string().min(1).max(128).optional(),
|
|
24
|
+
metricId: z
|
|
25
|
+
.string()
|
|
26
|
+
.regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/)
|
|
27
|
+
.optional(),
|
|
28
|
+
path: z.string().min(1).max(512).optional(),
|
|
29
|
+
archive: z.enum(['active', 'archived', 'all']).optional(),
|
|
30
|
+
taskState: taskStateSchema.optional(),
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
export const projectMetricCollections = [
|
|
34
|
+
'metrics',
|
|
35
|
+
'metricObservations',
|
|
36
|
+
'metricCorrections',
|
|
37
|
+
'metricGoals',
|
|
38
|
+
];
|
|
39
|
+
export const personalMetricCollections = [
|
|
40
|
+
'personalMetrics',
|
|
41
|
+
'personalMetricObservations',
|
|
42
|
+
'personalMetricCorrections',
|
|
43
|
+
'personalMetricGoals',
|
|
44
|
+
];
|
|
45
|
+
export const metricCollections = [...projectMetricCollections, ...personalMetricCollections];
|
|
46
|
+
export const metricHistoryCollections = [
|
|
47
|
+
'metricObservations',
|
|
48
|
+
'metricCorrections',
|
|
49
|
+
'personalMetricObservations',
|
|
50
|
+
'personalMetricCorrections',
|
|
51
|
+
];
|
|
52
|
+
export const metricReadSchema = resourceReadSchema
|
|
53
|
+
.omit({ path: true, taskState: true })
|
|
54
|
+
.extend({
|
|
55
|
+
collection: z.enum(metricCollections),
|
|
56
|
+
})
|
|
57
|
+
.strict();
|
|
58
|
+
|
|
59
|
+
/** Personal access is an explicit metric surface, never a generic account read.
|
|
60
|
+
* Current owner, grant and project rights are always checked by the server. */
|
|
61
|
+
export function validateResourceScope({ scope, collection, metricId, taskState }) {
|
|
62
|
+
if (taskState !== undefined && collection !== 'tasks') {
|
|
63
|
+
fail('invalid_arguments', 'taskState is available only for the tasks collection.');
|
|
64
|
+
}
|
|
65
|
+
if (
|
|
66
|
+
(scope.startsWith('personal:') && !personalMetricCollections.includes(collection)) ||
|
|
67
|
+
(personalMetricCollections.includes(collection) && !scope.startsWith('personal:')) ||
|
|
68
|
+
(projectMetricCollections.includes(collection) && !scope.startsWith('project:'))
|
|
69
|
+
) {
|
|
70
|
+
fail(
|
|
71
|
+
'invalid_arguments',
|
|
72
|
+
'Use metric definitions, observations, corrections or linked goals in their matching project or connected personal scope. Other personal collections are not exposed.',
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (metricId !== undefined && !metricHistoryCollections.includes(collection)) {
|
|
76
|
+
fail(
|
|
77
|
+
'invalid_arguments',
|
|
78
|
+
'metricId filters observations or correction snapshots only; use id for an exact definition or goal.',
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export async function readResources(client, input) {
|
|
83
|
+
const parsed = resourceReadSchema.safeParse(input);
|
|
84
|
+
if (!parsed.success) {
|
|
85
|
+
fail(
|
|
86
|
+
'invalid_arguments',
|
|
87
|
+
'Use a valid scope and collection with the returned epoch/checkpoint for continuation.',
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
const requested = parsed.data;
|
|
91
|
+
validateResourceScope(requested);
|
|
92
|
+
if (requested.after && (!requested.epoch || !requested.checkpoint)) {
|
|
93
|
+
fail(
|
|
94
|
+
'invalid_arguments',
|
|
95
|
+
'Continuation requires the unchanged epoch and checkpoint returned with the first page.',
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
const result = await client.get('resources', requested);
|
|
99
|
+
if (!validTaskAvailabilityPage(result, requested.collection, requested.taskState)) {
|
|
100
|
+
client.invalidateReads?.();
|
|
101
|
+
fail('invalid_response', 'The task availability snapshot was invalid; read the task again.');
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
export async function readMetrics(client, input) {
|
|
106
|
+
const parsed = metricReadSchema.safeParse(input);
|
|
107
|
+
if (!parsed.success) {
|
|
108
|
+
fail(
|
|
109
|
+
'invalid_arguments',
|
|
110
|
+
'Read a declared metric definition, observation, correction or linked-goal collection with the matching scope and bounded continuation.',
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return readResources(client, parsed.data);
|
|
114
|
+
}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import contract from './task-availability-contract.mjs';
|
|
3
|
+
|
|
4
|
+
export const taskAvailabilitySchema = z.fromJSONSchema(contract);
|
|
5
|
+
|
|
6
|
+
/** Validate only the optional projection. Its head belongs to the current task
|
|
7
|
+
* module, not necessarily the page's historical checkpoint or the row revision.
|
|
8
|
+
* Legacy absence is retained; it must never become an invented unlocked state. */
|
|
9
|
+
export function validTaskAvailabilityPage(page, collection, taskState) {
|
|
10
|
+
if (!Array.isArray(page?.items)) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return page.items.every((item) => {
|
|
14
|
+
if (!item || !Object.hasOwn(item, 'taskAvailability')) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
collection === 'tasks' &&
|
|
19
|
+
taskState === 'v1' &&
|
|
20
|
+
item.kind !== 'remove' &&
|
|
21
|
+
taskAvailabilitySchema.safeParse(item.taskAvailability).success &&
|
|
22
|
+
item.taskAvailability.source.epoch === page.epoch
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
}
|
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
|
-
(
|
|
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 ?
|
|
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);
|