@rubytech/create-maxy-code 0.1.75 → 0.1.79
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/__tests__/plugin-install.test.js +2 -2
- package/dist/lib/plugin-install.js +1 -1
- package/package.json +1 -1
- package/payload/platform/config/brand.json +1 -1
- package/payload/platform/lib/graph-write/dist/index.js +1 -1
- package/payload/platform/lib/graph-write/src/index.ts +1 -1
- package/payload/platform/package.json +1 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +101 -1
- package/payload/platform/plugins/admin/mcp/dist/index.js +1 -1
- package/payload/platform/plugins/admin/skills/commitment-followthrough/SKILL.md +1 -1
- package/payload/platform/plugins/admin/skills/session-management/SKILL.md +1 -1
- package/payload/platform/plugins/business-assistant/PLUGIN.md +1 -1
- package/payload/platform/plugins/business-assistant/references/task-management.md +13 -13
- package/payload/platform/plugins/docs/references/admin-session.md +7 -6
- package/payload/platform/plugins/docs/references/internals.md +2 -2
- package/payload/platform/plugins/memory/PLUGIN.md +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.js +57 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/neo4j-password-path.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js +9 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -0
- package/payload/platform/plugins/memory/skills/conversation-archive-enrich/SKILL.md +2 -2
- package/payload/platform/plugins/projects/PLUGIN.md +3 -3
- package/payload/platform/plugins/projects/references/sprint.md +2 -2
- package/payload/platform/plugins/scheduling/skills/briefing/SKILL.md +2 -2
- package/payload/platform/plugins/tasks/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/work/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/{tasks → work}/.mcp.json +2 -2
- package/payload/platform/plugins/work/PLUGIN.md +120 -0
- package/payload/platform/plugins/work/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/work/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/index.js +543 -0
- package/payload/platform/plugins/work/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.d.ts +7 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.js +24 -0
- package/payload/platform/plugins/work/mcp/dist/lib/embeddings.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/work/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.d.ts +17 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.js +76 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-complete.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.d.ts +29 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.js +235 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-create.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.d.ts +40 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.js +125 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-get.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.d.ts +26 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.js +81 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-list.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.d.ts +19 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.js +102 -0
- package/payload/platform/plugins/work/mcp/dist/tools/project-update.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.d.ts +20 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.js +37 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-list.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.d.ts +12 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.js +28 -0
- package/payload/platform/plugins/work/mcp/dist/tools/session-name.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.d.ts +16 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.js +33 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-complete.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts +63 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.js +141 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-create.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.d.ts +19 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.js +51 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-get.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.d.ts +18 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.js +66 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-list.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.d.ts +21 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.js +54 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-ready.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.d.ts +12 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.js +59 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-relate.js.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.d.ts +32 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.d.ts.map +1 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.js +112 -0
- package/payload/platform/plugins/work/mcp/dist/tools/work-update.js.map +1 -0
- package/payload/platform/plugins/{tasks → work}/mcp/package.json +1 -1
- package/payload/platform/scripts/conversation-id-allowlist.txt +4 -4
- package/payload/platform/scripts/seed-neo4j.sh +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +34 -5
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +32 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +33 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +170 -39
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.js +10 -4
- package/payload/platform/services/claude-session-manager/dist/specialist-drift.js.map +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +21 -37
- package/payload/platform/templates/specialists/agents/database-operator.md +1 -1
- package/payload/platform/templates/specialists/agents/librarian.md +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/platform/templates/specialists/agents/project-manager.md +3 -3
- package/payload/premium-plugins/real-agent/plugins/leads/PLUGIN.md +1 -1
- package/payload/server/{chunk-ITQ55PCQ.js → chunk-TFEIFU7F.js} +1 -1
- package/payload/server/{chunk-HZ77KMTV.js → chunk-W33UUYYR.js} +1 -4
- package/payload/server/{cloudflare-task-tracker-PZBX7X3D.js → cloudflare-task-tracker-7P355PSD.js} +1 -1
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/server.js +50 -18
- package/payload/platform/plugins/tasks/PLUGIN.md +0 -120
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TaskDetail {
|
|
2
|
+
taskId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
status: string;
|
|
6
|
+
priority: string;
|
|
7
|
+
dueDate?: string;
|
|
8
|
+
notes?: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
relationships: Array<{
|
|
12
|
+
type: string;
|
|
13
|
+
targetLabel: string;
|
|
14
|
+
targetId: string;
|
|
15
|
+
targetName?: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export declare function workGet(taskId: string, accountId: string): Promise<TaskDetail | null>;
|
|
19
|
+
//# sourceMappingURL=work-get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-get.d.ts","sourceRoot":"","sources":["../../src/tools/work-get.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA4D3F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getSession } from "../lib/neo4j.js";
|
|
2
|
+
export async function workGet(taskId, accountId) {
|
|
3
|
+
const session = getSession();
|
|
4
|
+
try {
|
|
5
|
+
// Fetch the task node
|
|
6
|
+
const taskResult = await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId}) RETURN t`, { taskId, accountId });
|
|
7
|
+
if (taskResult.records.length === 0)
|
|
8
|
+
return null;
|
|
9
|
+
const t = taskResult.records[0].get("t").properties;
|
|
10
|
+
// Fetch all outgoing relationships
|
|
11
|
+
const relResult = await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId})-[r]->(target)
|
|
12
|
+
RETURN type(r) AS relType, labels(target) AS targetLabels, elementId(target) AS targetId,
|
|
13
|
+
target.name AS targetName, target.givenName AS targetGivenName,
|
|
14
|
+
target.taskId AS targetTaskId`, { taskId, accountId });
|
|
15
|
+
const relationships = relResult.records.map((rec) => {
|
|
16
|
+
const targetLabels = rec.get("targetLabels");
|
|
17
|
+
const targetLabel = targetLabels[0] ?? "Unknown";
|
|
18
|
+
const targetId = rec.get("targetId");
|
|
19
|
+
// Best-effort name resolution across node types
|
|
20
|
+
const targetName = rec.get("targetName") ??
|
|
21
|
+
rec.get("targetGivenName") ??
|
|
22
|
+
rec.get("targetTaskId") ??
|
|
23
|
+
targetId;
|
|
24
|
+
return {
|
|
25
|
+
type: rec.get("relType"),
|
|
26
|
+
targetLabel,
|
|
27
|
+
targetId,
|
|
28
|
+
targetName,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
const detail = {
|
|
32
|
+
taskId: t.taskId,
|
|
33
|
+
name: t.name,
|
|
34
|
+
description: t.description,
|
|
35
|
+
status: t.status,
|
|
36
|
+
priority: t.priority,
|
|
37
|
+
createdAt: t.createdAt,
|
|
38
|
+
updatedAt: t.updatedAt,
|
|
39
|
+
relationships,
|
|
40
|
+
};
|
|
41
|
+
if (t.dueDate)
|
|
42
|
+
detail.dueDate = t.dueDate;
|
|
43
|
+
if (t.notes)
|
|
44
|
+
detail.notes = t.notes;
|
|
45
|
+
return detail;
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
await session.close();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=work-get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-get.js","sourceRoot":"","sources":["../../src/tools/work-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAoB7C,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,MAAc,EAAE,SAAiB;IAC7D,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,sBAAsB;QACtB,MAAM,UAAU,GAAG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AC9B,SAAS,EAAE,CAAC,CAAC,SAAmB;YAChC,SAAS,EAAE,CAAC,CAAC,SAAmB;YAChC,aAAa;SACd,CAAC;QAEF,IAAI,CAAC,CAAC,OAAO;YAAE,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,OAAiB,CAAC;QACpD,IAAI,CAAC,CAAC,KAAK;YAAE,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAe,CAAC;QAE9C,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TaskListParams {
|
|
2
|
+
accountId: string;
|
|
3
|
+
status?: string;
|
|
4
|
+
priority?: string;
|
|
5
|
+
relatedEntityId?: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface TaskSummary {
|
|
9
|
+
taskId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
status: string;
|
|
12
|
+
priority: string;
|
|
13
|
+
dueDate?: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function workList(params: TaskListParams): Promise<TaskSummary[]>;
|
|
18
|
+
//# sourceMappingURL=work-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-list.d.ts","sourceRoot":"","sources":["../../src/tools/work-list.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CA8D7E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { int } from "neo4j-driver";
|
|
2
|
+
import { getSession } from "../lib/neo4j.js";
|
|
3
|
+
export async function workList(params) {
|
|
4
|
+
const { accountId, status, priority, relatedEntityId, limit = 50 } = params;
|
|
5
|
+
const session = getSession();
|
|
6
|
+
try {
|
|
7
|
+
let query;
|
|
8
|
+
const queryParams = { accountId, limit: int(limit) };
|
|
9
|
+
if (relatedEntityId) {
|
|
10
|
+
// Tasks related to a specific entity via any relationship
|
|
11
|
+
query = `
|
|
12
|
+
MATCH (t:Task {accountId: $accountId})-[]->(e)
|
|
13
|
+
WHERE elementId(e) = $relatedEntityId
|
|
14
|
+
${status ? "AND t.status = $status" : ""}
|
|
15
|
+
${priority ? "AND t.priority = $priority" : ""}
|
|
16
|
+
RETURN t
|
|
17
|
+
ORDER BY t.createdAt DESC
|
|
18
|
+
LIMIT $limit
|
|
19
|
+
`;
|
|
20
|
+
queryParams.relatedEntityId = relatedEntityId;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
query = `
|
|
24
|
+
MATCH (t:Task {accountId: $accountId})
|
|
25
|
+
${status || priority ? "WHERE" : ""}
|
|
26
|
+
${status ? "t.status = $status" : ""}
|
|
27
|
+
${status && priority ? "AND" : ""}
|
|
28
|
+
${priority ? "t.priority = $priority" : ""}
|
|
29
|
+
RETURN t
|
|
30
|
+
ORDER BY
|
|
31
|
+
CASE t.priority
|
|
32
|
+
WHEN 'urgent' THEN 0
|
|
33
|
+
WHEN 'high' THEN 1
|
|
34
|
+
WHEN 'normal' THEN 2
|
|
35
|
+
WHEN 'low' THEN 3
|
|
36
|
+
ELSE 4
|
|
37
|
+
END,
|
|
38
|
+
t.createdAt DESC
|
|
39
|
+
LIMIT $limit
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
if (status)
|
|
43
|
+
queryParams.status = status;
|
|
44
|
+
if (priority)
|
|
45
|
+
queryParams.priority = priority;
|
|
46
|
+
const result = await session.run(query, queryParams);
|
|
47
|
+
return result.records.map((rec) => {
|
|
48
|
+
const t = rec.get("t").properties;
|
|
49
|
+
const summary = {
|
|
50
|
+
taskId: t.taskId,
|
|
51
|
+
name: t.name,
|
|
52
|
+
status: t.status,
|
|
53
|
+
priority: t.priority,
|
|
54
|
+
createdAt: t.createdAt,
|
|
55
|
+
updatedAt: t.updatedAt,
|
|
56
|
+
};
|
|
57
|
+
if (t.dueDate)
|
|
58
|
+
summary.dueDate = t.dueDate;
|
|
59
|
+
return summary;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
await session.close();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=work-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-list.js","sourceRoot":"","sources":["../../src/tools/work-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAoB7C,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAAsB;IACnD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAE5E,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,IAAI,KAAa,CAAC;QAClB,MAAM,WAAW,GAA4B,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAA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ACjC,CAAC;YACF,IAAI,CAAC,CAAC,OAAO;gBAAE,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,OAAiB,CAAC;YACrD,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ReadyTask {
|
|
2
|
+
taskId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
priority: string;
|
|
6
|
+
dueDate?: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns tasks that are safe to start: status=pending, zero unresolved
|
|
11
|
+
* BLOCKS, and no AFFECTS conflict with currently active tasks.
|
|
12
|
+
*
|
|
13
|
+
* This is the product equivalent of the development lane compatibility
|
|
14
|
+
* matrix — it answers "what can I work on next without conflict?"
|
|
15
|
+
*
|
|
16
|
+
* Pending task is READY when:
|
|
17
|
+
* 1. No incomplete task BLOCKS it (sequential dependency)
|
|
18
|
+
* 2. No active task AFFECTS the same entity (conflict detection)
|
|
19
|
+
*/
|
|
20
|
+
export declare function workReady(accountId: string): Promise<ReadyTask[]>;
|
|
21
|
+
//# sourceMappingURL=work-ready.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-ready.d.ts","sourceRoot":"","sources":["../../src/tools/work-ready.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CA0CvE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getSession } from "../lib/neo4j.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns tasks that are safe to start: status=pending, zero unresolved
|
|
4
|
+
* BLOCKS, and no AFFECTS conflict with currently active tasks.
|
|
5
|
+
*
|
|
6
|
+
* This is the product equivalent of the development lane compatibility
|
|
7
|
+
* matrix — it answers "what can I work on next without conflict?"
|
|
8
|
+
*
|
|
9
|
+
* Pending task is READY when:
|
|
10
|
+
* 1. No incomplete task BLOCKS it (sequential dependency)
|
|
11
|
+
* 2. No active task AFFECTS the same entity (conflict detection)
|
|
12
|
+
*/
|
|
13
|
+
export async function workReady(accountId) {
|
|
14
|
+
const session = getSession();
|
|
15
|
+
try {
|
|
16
|
+
const result = await session.run(`MATCH (t:Task {accountId: $accountId, status: 'pending'})
|
|
17
|
+
WHERE NOT EXISTS {
|
|
18
|
+
MATCH (blocker:Task {accountId: $accountId})-[:BLOCKS]->(t)
|
|
19
|
+
WHERE blocker.status IN ['pending', 'active']
|
|
20
|
+
}
|
|
21
|
+
AND NOT EXISTS {
|
|
22
|
+
MATCH (t)-[:AFFECTS]->(entity)<-[:AFFECTS]-(active:Task {accountId: $accountId})
|
|
23
|
+
WHERE active.status = 'active'
|
|
24
|
+
}
|
|
25
|
+
RETURN t
|
|
26
|
+
ORDER BY
|
|
27
|
+
CASE t.priority
|
|
28
|
+
WHEN 'urgent' THEN 0
|
|
29
|
+
WHEN 'high' THEN 1
|
|
30
|
+
WHEN 'normal' THEN 2
|
|
31
|
+
WHEN 'low' THEN 3
|
|
32
|
+
ELSE 4
|
|
33
|
+
END,
|
|
34
|
+
t.createdAt ASC
|
|
35
|
+
LIMIT 50`, { accountId });
|
|
36
|
+
return result.records.map((rec) => {
|
|
37
|
+
const t = rec.get("t").properties;
|
|
38
|
+
const task = {
|
|
39
|
+
taskId: t.taskId,
|
|
40
|
+
name: t.name,
|
|
41
|
+
description: t.description,
|
|
42
|
+
priority: t.priority,
|
|
43
|
+
createdAt: t.createdAt,
|
|
44
|
+
};
|
|
45
|
+
if (t.dueDate)
|
|
46
|
+
task.dueDate = t.dueDate;
|
|
47
|
+
return task;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await session.close();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=work-ready.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-ready.js","sourceRoot":"","sources":["../../src/tools/work-ready.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAW7C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,SAAiB;IAC/C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B;;;;;;;;;;;;;;;;;;;gBAmBU,EACV,EAAE,SAAS,EAAE,CACd,CAAC;QAEF,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;YAClC,MAAM,IAAI,GAAc;gBACtB,MAAM,EAAE,CAAC,CAAC,MAAgB;gBAC1B,IAAI,EAAE,CAAC,CAAC,IAAc;gBACtB,WAAW,EAAE,CAAC,CAAC,WAAqB;gBACpC,QAAQ,EAAE,CAAC,CAAC,QAAkB;gBAC9B,SAAS,EAAE,CAAC,CAAC,SAAmB;aACjC,CAAC;YACF,IAAI,CAAC,CAAC,OAAO;gBAAE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,OAAiB,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const ALLOWED_REL_TYPES: readonly ["AFFECTS", "RAISED_BY", "PART_OF", "BLOCKS"];
|
|
2
|
+
type RelType = typeof ALLOWED_REL_TYPES[number];
|
|
3
|
+
export interface TaskRelateParams {
|
|
4
|
+
taskId: string;
|
|
5
|
+
accountId: string;
|
|
6
|
+
targetId: string;
|
|
7
|
+
targetLabel: string;
|
|
8
|
+
relType: RelType;
|
|
9
|
+
}
|
|
10
|
+
export declare function workRelate(params: TaskRelateParams): Promise<void>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=work-relate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-relate.d.ts","sourceRoot":"","sources":["../../src/tools/work-relate.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,iBAAiB,wDAAyD,CAAC;AACjF,KAAK,OAAO,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAIhD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwExE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getSession } from "../lib/neo4j.js";
|
|
2
|
+
const ALLOWED_REL_TYPES = ["AFFECTS", "RAISED_BY", "PART_OF", "BLOCKS"];
|
|
3
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4
|
+
export async function workRelate(params) {
|
|
5
|
+
const { taskId, accountId, targetId, targetLabel, relType } = params;
|
|
6
|
+
if (!ALLOWED_REL_TYPES.includes(relType)) {
|
|
7
|
+
throw new Error(`Invalid relationship type: ${relType}. Must be one of: ${ALLOWED_REL_TYPES.join(", ")}`);
|
|
8
|
+
}
|
|
9
|
+
const isTaskTarget = targetLabel === "Task";
|
|
10
|
+
const session = getSession();
|
|
11
|
+
try {
|
|
12
|
+
// Verify the source task exists
|
|
13
|
+
const taskCheck = await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId}) RETURN t`, { taskId, accountId });
|
|
14
|
+
if (taskCheck.records.length === 0) {
|
|
15
|
+
throw new Error(`Task not found: ${taskId}`);
|
|
16
|
+
}
|
|
17
|
+
// Verify the target node exists
|
|
18
|
+
// Task targets: match by taskId property (UUID from task-create)
|
|
19
|
+
// Non-Task targets: match by elementId (from memory-search results)
|
|
20
|
+
let targetCheck;
|
|
21
|
+
if (isTaskTarget) {
|
|
22
|
+
targetCheck = await session.run(`MATCH (target:Task {taskId: $targetId, accountId: $accountId}) RETURN target`, { targetId, accountId });
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
targetCheck = await session.run(`MATCH (target)
|
|
26
|
+
WHERE elementId(target) = $targetId AND $targetLabel IN labels(target)
|
|
27
|
+
RETURN target`, { targetId, targetLabel });
|
|
28
|
+
}
|
|
29
|
+
if (targetCheck.records.length === 0) {
|
|
30
|
+
if (isTaskTarget) {
|
|
31
|
+
const hint = !UUID_RE.test(targetId)
|
|
32
|
+
? ` (the value looks like an elementId, not a UUID — use the taskId returned by task-create)`
|
|
33
|
+
: "";
|
|
34
|
+
throw new Error(`Target task not found with taskId: ${targetId}${hint}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const hint = UUID_RE.test(targetId)
|
|
38
|
+
? ` (the value looks like a UUID — non-Task targets require an elementId from memory-search)`
|
|
39
|
+
: "";
|
|
40
|
+
throw new Error(`Target ${targetLabel} not found with elementId: ${targetId}${hint}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Create the relationship (idempotent — MERGE avoids duplicates)
|
|
44
|
+
if (isTaskTarget) {
|
|
45
|
+
await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId})
|
|
46
|
+
MATCH (target:Task {taskId: $targetId, accountId: $accountId})
|
|
47
|
+
MERGE (t)-[:${relType}]->(target)`, { taskId, accountId, targetId });
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId})
|
|
51
|
+
MATCH (target) WHERE elementId(target) = $targetId
|
|
52
|
+
MERGE (t)-[:${relType}]->(target)`, { taskId, accountId, targetId });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
await session.close();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=work-relate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-relate.js","sourceRoot":"","sources":["../../src/tools/work-relate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAGjF,MAAM,OAAO,GAAG,iEAAiE,CAAC;AAUlF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAwB;IACvD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAErE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,qBAAqB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,MAAM,YAAY,GAAG,WAAW,KAAK,MAAM,CAAC;IAE5C,MAAM,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;QACjE,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,OAAO,CAAC,GAAG,CACf;;uBAEe,OAAO,aAAa,EACnC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAChC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,CAAC,GAAG,CACf;;uBAEe,OAAO,aAAa,EACnC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAChC,CAAC;QACJ,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface TaskUpdateParams {
|
|
2
|
+
taskId: string;
|
|
3
|
+
accountId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Status enum (`running` discriminates "action mid-flight" from `active`
|
|
8
|
+
* ("commitment accepted")). Transition
|
|
9
|
+
* to `completed` or `failed` auto-sets `completedAt`. Transition to
|
|
10
|
+
* `failed` also requires `errorMessage` to be non-empty.
|
|
11
|
+
*/
|
|
12
|
+
status?: "pending" | "active" | "running" | "completed" | "failed" | "cancelled";
|
|
13
|
+
priority?: "low" | "normal" | "high" | "urgent";
|
|
14
|
+
dueDate?: string;
|
|
15
|
+
/** Appended to notes with a timestamp — never overwrites */
|
|
16
|
+
note?: string;
|
|
17
|
+
/**
|
|
18
|
+
* append a single step label to the Task's `steps[]` array.
|
|
19
|
+
* Atomic Cypher SET t.steps = coalesce(t.steps, []) + $step (no
|
|
20
|
+
* read-modify-write race). Each appendStep call adds one entry; emit
|
|
21
|
+
* one call per phase of the action.
|
|
22
|
+
*/
|
|
23
|
+
appendStep?: string;
|
|
24
|
+
/**
|
|
25
|
+
* error message stored on the Task when status transitions
|
|
26
|
+
* to `failed`. Required for the `failed` transition; empty errorMessage
|
|
27
|
+
* with status=failed is rejected.
|
|
28
|
+
*/
|
|
29
|
+
errorMessage?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function workUpdate(params: TaskUpdateParams): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=work-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-update.d.ts","sourceRoot":"","sources":["../../src/tools/work-update.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IACjF,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsIxE"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { getSession } from "../lib/neo4j.js";
|
|
2
|
+
import { computeEmbedding } from "../lib/embeddings.js";
|
|
3
|
+
export async function workUpdate(params) {
|
|
4
|
+
const { taskId, accountId, name, description, status, priority, dueDate, note, appendStep, errorMessage } = params;
|
|
5
|
+
if (status === "failed" && (!errorMessage || errorMessage.trim().length === 0)) {
|
|
6
|
+
throw new Error("task-update: errorMessage is required when status transitions to 'failed'.");
|
|
7
|
+
}
|
|
8
|
+
const session = getSession();
|
|
9
|
+
try {
|
|
10
|
+
// Fetch current task to build updated embedding and append note. Also
|
|
11
|
+
// fetches `kind` so the lifecycle log line below knows whether this
|
|
12
|
+
// Task is an action record (kind set) vs commitment-tracking (kind null).
|
|
13
|
+
const existing = await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId})
|
|
14
|
+
RETURN t.name AS name, t.description AS description, t.notes AS notes,
|
|
15
|
+
t.status AS status, t.priority AS priority, t.kind AS kind,
|
|
16
|
+
size(coalesce(t.steps, [])) AS stepsCount`, { taskId, accountId });
|
|
17
|
+
if (existing.records.length === 0) {
|
|
18
|
+
throw new Error(`Task not found: ${taskId}`);
|
|
19
|
+
}
|
|
20
|
+
const rec = existing.records[0];
|
|
21
|
+
const currentName = rec.get("name");
|
|
22
|
+
const currentDescription = rec.get("description");
|
|
23
|
+
const currentNotes = rec.get("notes") ?? "";
|
|
24
|
+
const currentStatus = rec.get("status");
|
|
25
|
+
const currentPriority = rec.get("priority");
|
|
26
|
+
const kind = rec.get("kind") ?? null;
|
|
27
|
+
const newName = name ?? currentName;
|
|
28
|
+
const newDescription = description ?? currentDescription;
|
|
29
|
+
const newStatus = status ?? currentStatus;
|
|
30
|
+
const newPriority = priority ?? currentPriority;
|
|
31
|
+
// Append note with timestamp (append-only — never overwrite)
|
|
32
|
+
let newNotes = currentNotes;
|
|
33
|
+
if (note) {
|
|
34
|
+
const timestamp = new Date().toISOString().slice(0, 16).replace("T", " ");
|
|
35
|
+
newNotes = currentNotes
|
|
36
|
+
? `${currentNotes}\n[${timestamp}] ${note}`
|
|
37
|
+
: `[${timestamp}] ${note}`;
|
|
38
|
+
}
|
|
39
|
+
const nowIso = new Date().toISOString();
|
|
40
|
+
const setClauses = [
|
|
41
|
+
"t.status = $status",
|
|
42
|
+
"t.priority = $priority",
|
|
43
|
+
"t.notes = $notes",
|
|
44
|
+
"t.updatedAt = $updatedAt",
|
|
45
|
+
];
|
|
46
|
+
const queryParams = {
|
|
47
|
+
taskId,
|
|
48
|
+
accountId,
|
|
49
|
+
status: newStatus,
|
|
50
|
+
priority: newPriority,
|
|
51
|
+
notes: newNotes,
|
|
52
|
+
updatedAt: nowIso,
|
|
53
|
+
};
|
|
54
|
+
if (name !== undefined) {
|
|
55
|
+
setClauses.push("t.name = $name");
|
|
56
|
+
queryParams.name = name;
|
|
57
|
+
}
|
|
58
|
+
if (description !== undefined) {
|
|
59
|
+
setClauses.push("t.description = $description");
|
|
60
|
+
queryParams.description = description;
|
|
61
|
+
}
|
|
62
|
+
if (dueDate !== undefined) {
|
|
63
|
+
setClauses.push("t.dueDate = $dueDate");
|
|
64
|
+
queryParams.dueDate = dueDate;
|
|
65
|
+
}
|
|
66
|
+
// atomic steps[] append. Cypher `coalesce(t.steps, []) + $step`
|
|
67
|
+
// is one round-trip; no read-modify-write race even under concurrent
|
|
68
|
+
// appends (executeWrite serializes per-tx). Distinct from notes which
|
|
69
|
+
// is a free-form string field; steps is a structured action-phase log.
|
|
70
|
+
if (appendStep !== undefined) {
|
|
71
|
+
setClauses.push("t.steps = coalesce(t.steps, []) + $appendStep");
|
|
72
|
+
queryParams.appendStep = appendStep;
|
|
73
|
+
}
|
|
74
|
+
// completion lifecycle. completedAt set on terminal status
|
|
75
|
+
// transitions (completed | failed). errorMessage only persisted on
|
|
76
|
+
// `failed` (the contract above already validates non-empty).
|
|
77
|
+
if (status === "completed" || status === "failed") {
|
|
78
|
+
setClauses.push("t.completedAt = $completedAt");
|
|
79
|
+
queryParams.completedAt = nowIso;
|
|
80
|
+
}
|
|
81
|
+
if (status === "failed") {
|
|
82
|
+
setClauses.push("t.errorMessage = $errorMessage");
|
|
83
|
+
queryParams.errorMessage = errorMessage;
|
|
84
|
+
}
|
|
85
|
+
// Re-embed with updated values (substitute new name/description when provided)
|
|
86
|
+
const embeddingText = `Task: ${newName} — ${newDescription} status: ${newStatus} priority: ${newPriority}${newNotes ? " " + newNotes : ""}`;
|
|
87
|
+
const embedding = await computeEmbedding(embeddingText);
|
|
88
|
+
if (embedding.length > 0) {
|
|
89
|
+
setClauses.push("t.embedding = $embedding");
|
|
90
|
+
queryParams.embedding = embedding;
|
|
91
|
+
}
|
|
92
|
+
const updateRes = await session.run(`MATCH (t:Task {taskId: $taskId, accountId: $accountId})
|
|
93
|
+
SET ${setClauses.join(", ")}
|
|
94
|
+
RETURN size(coalesce(t.steps, [])) AS stepsCount`, queryParams);
|
|
95
|
+
// Lifecycle log lines — only for action Tasks (kind set). Commitment-
|
|
96
|
+
// tracking callers (no kind) stay silent on this channel so existing
|
|
97
|
+
// [task] grep targets aren't flooded with non-action noise.
|
|
98
|
+
if (kind) {
|
|
99
|
+
if (appendStep !== undefined) {
|
|
100
|
+
process.stderr.write(`[task] action-step kind=${kind} taskId=${taskId} step=${appendStep}\n`);
|
|
101
|
+
}
|
|
102
|
+
if (status === "completed" || status === "failed") {
|
|
103
|
+
const stepsCount = updateRes.records[0]?.get("stepsCount")?.toNumber?.() ?? 0;
|
|
104
|
+
process.stderr.write(`[task] action-done kind=${kind} taskId=${taskId} status=${status} stepsCount=${stepsCount}\n`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
await session.close();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=work-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-update.js","sourceRoot":"","sources":["../../src/tools/work-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAiCxD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAwB;IACvD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAEnH,IAAI,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,YAA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AI,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAClD,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;gBAC9E,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2BAA2B,IAAI,WAAW,MAAM,WAAW,MAAM,eAAe,UAAU,IAAI,CAC/F,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -51,10 +51,10 @@ platform/plugins/memory/skills/conversation-archive/SKILL.md
|
|
|
51
51
|
platform/plugins/memory/skills/conversational-memory/SKILL.md
|
|
52
52
|
platform/plugins/memory/skills/document-ingest/SKILL.md
|
|
53
53
|
platform/plugins/scheduling/mcp/src/index.ts
|
|
54
|
-
platform/plugins/
|
|
55
|
-
platform/plugins/
|
|
56
|
-
platform/plugins/
|
|
57
|
-
platform/plugins/
|
|
54
|
+
platform/plugins/work/.mcp.json
|
|
55
|
+
platform/plugins/work/mcp/src/index.ts
|
|
56
|
+
platform/plugins/work/mcp/src/tools/project-create.ts
|
|
57
|
+
platform/plugins/work/mcp/src/tools/session-list.ts
|
|
58
58
|
platform/plugins/waitlist/mcp/src/index.ts
|
|
59
59
|
platform/plugins/waitlist/mcp/src/tools/__tests__/waitlist-persist.test.ts
|
|
60
60
|
platform/plugins/waitlist/mcp/src/tools/waitlist-heal.ts
|
|
@@ -76,7 +76,7 @@ ACCOUNT_SETTINGS="$ACCOUNT_DIR/.claude/settings.json"
|
|
|
76
76
|
# Including optional plugins here is safe — permissions without a running
|
|
77
77
|
# MCP server are inert. This ensures tools are allowed when the user
|
|
78
78
|
# enables an optional plugin, without requiring a re-seed.
|
|
79
|
-
MAXY_PERMISSIONS='["Read","Edit","Write","Bash","Glob","Grep","Agent","mcp__memory__*","mcp__contacts__*","mcp__telegram__*","mcp__admin__*","mcp__cloudflare__*","
|
|
79
|
+
MAXY_PERMISSIONS='["Read","Edit","Write","Bash","Glob","Grep","Agent","mcp__memory__*","mcp__contacts__*","mcp__telegram__*","mcp__admin__*","mcp__cloudflare__*","mcp__work__*","mcp__scheduling__*","mcp__email__*","mcp__workflows__*","mcp__web__*","mcp__plugin_playwright_playwright__*"]'
|
|
80
80
|
|
|
81
81
|
# Append wildcard permissions for any optional plugins not already covered
|
|
82
82
|
PLUGINS_DIR="$(dirname "$0")/../plugins"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAA0E,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAIzH,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAoB3D;4CAC4C;AAC5C,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AA0ED,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAAC;IACvF,KAAK,EAAE,YAAY,CAAA;IACnB,OAAO,EAAE,SAAS,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,WAAW,CAAA;IAC/B,eAAe,EAAE,aAAa,CAAA;CAC/B;AAwHD;;;kEAGkE;AAClE,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG;IAC3B,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAA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