@pellux/goodvibes-sdk 0.18.17 → 0.18.19
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/_internal/platform/agents/orchestrator-runner.d.ts +5 -4
- package/dist/_internal/platform/agents/orchestrator-runner.d.ts.map +1 -1
- package/dist/_internal/platform/agents/orchestrator-runner.js +9 -8
- package/dist/_internal/platform/agents/orchestrator.d.ts.map +1 -1
- package/dist/_internal/platform/agents/orchestrator.js +1 -0
- package/dist/_internal/platform/agents/wrfc-controller.d.ts +2 -1
- package/dist/_internal/platform/agents/wrfc-controller.d.ts.map +1 -1
- package/dist/_internal/platform/agents/wrfc-controller.js +6 -6
- package/dist/_internal/platform/agents/wrfc-workmap.d.ts +4 -1
- package/dist/_internal/platform/agents/wrfc-workmap.d.ts.map +1 -1
- package/dist/_internal/platform/agents/wrfc-workmap.js +4 -2
- package/dist/_internal/platform/automation/schedules.js +1 -1
- package/dist/_internal/platform/bookmarks/manager.d.ts +1 -1
- package/dist/_internal/platform/bookmarks/manager.js +1 -1
- package/dist/_internal/platform/config/schema-domain-core.js +1 -1
- package/dist/_internal/platform/config/schema-domain-runtime.js +1 -1
- package/dist/_internal/platform/config/service-registry.d.ts +1 -1
- package/dist/_internal/platform/config/service-registry.js +1 -1
- package/dist/_internal/platform/config/subscription-providers.js +1 -1
- package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.js +4 -0
- package/dist/_internal/platform/daemon/service-manager.d.ts +8 -0
- package/dist/_internal/platform/daemon/service-manager.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/service-manager.js +41 -27
- package/dist/_internal/platform/input/keybindings.d.ts +2 -1
- package/dist/_internal/platform/input/keybindings.d.ts.map +1 -1
- package/dist/_internal/platform/input/keybindings.js +2 -1
- package/dist/_internal/platform/intelligence/config.d.ts +1 -1
- package/dist/_internal/platform/intelligence/config.d.ts.map +1 -1
- package/dist/_internal/platform/intelligence/config.js +8 -4
- package/dist/_internal/platform/intelligence/facade.d.ts +1 -1
- package/dist/_internal/platform/intelligence/facade.js +2 -2
- package/dist/_internal/platform/profiles/manager.d.ts +1 -1
- package/dist/_internal/platform/profiles/manager.js +1 -1
- package/dist/_internal/platform/providers/anthropic-compat.d.ts +1 -1
- package/dist/_internal/platform/providers/anthropic-compat.js +1 -1
- package/dist/_internal/platform/providers/custom-loader.d.ts +1 -1
- package/dist/_internal/platform/providers/registry.d.ts +2 -2
- package/dist/_internal/platform/providers/registry.js +2 -2
- package/dist/_internal/platform/runtime/ecosystem/catalog.js +6 -6
- package/dist/_internal/platform/runtime/sandbox/provisioning.d.ts +11 -8
- package/dist/_internal/platform/runtime/sandbox/provisioning.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/services.js +3 -2
- package/dist/_internal/platform/runtime/session-persistence.d.ts +1 -0
- package/dist/_internal/platform/runtime/session-persistence.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/session-persistence.js +4 -4
- package/dist/_internal/platform/runtime/surface-root.d.ts +2 -0
- package/dist/_internal/platform/runtime/surface-root.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/surface-root.js +8 -0
- package/dist/_internal/platform/runtime/worktree/registry.d.ts +5 -1
- package/dist/_internal/platform/runtime/worktree/registry.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/worktree/registry.js +20 -17
- package/dist/_internal/platform/scheduler/scheduler.d.ts +1 -1
- package/dist/_internal/platform/scheduler/scheduler.js +1 -1
- package/dist/_internal/platform/sessions/manager.d.ts +5 -2
- package/dist/_internal/platform/sessions/manager.d.ts.map +1 -1
- package/dist/_internal/platform/sessions/manager.js +4 -3
- package/dist/_internal/platform/tools/fetch/schema.d.ts +1 -1
- package/dist/_internal/platform/tools/fetch/schema.js +1 -1
- package/dist/_internal/platform/tools/index.js +6 -6
- package/dist/_internal/platform/tools/packet/index.d.ts +4 -1
- package/dist/_internal/platform/tools/packet/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/packet/index.js +5 -2
- package/dist/_internal/platform/tools/query/index.d.ts +4 -1
- package/dist/_internal/platform/tools/query/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/query/index.js +5 -2
- package/dist/_internal/platform/tools/registry-tool/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/registry-tool/index.js +2 -4
- package/dist/_internal/platform/tools/registry-tool/skill-loader.d.ts.map +1 -1
- package/dist/_internal/platform/tools/registry-tool/skill-loader.js +1 -2
- package/dist/_internal/platform/tools/team/index.d.ts +3 -0
- package/dist/_internal/platform/tools/team/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/team/index.js +124 -119
- package/dist/_internal/platform/tools/worklist/index.d.ts +3 -0
- package/dist/_internal/platform/tools/worklist/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/worklist/index.js +108 -103
- package/dist/_internal/platform/watchers/store.d.ts.map +1 -1
- package/dist/_internal/platform/watchers/store.js +3 -2
- package/package.json +1 -1
|
@@ -19,8 +19,8 @@ import { createWorkflowServices, createWorkflowTool } from '@pellux/goodvibes-sd
|
|
|
19
19
|
import { createRegistryTool } from '@pellux/goodvibes-sdk/platform/tools/registry-tool/index';
|
|
20
20
|
import { KVState } from '@pellux/goodvibes-sdk/platform/state/kv-state';
|
|
21
21
|
import { createTaskTool } from '@pellux/goodvibes-sdk/platform/tools/task/index';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
22
|
+
import { createTeamTool } from '@pellux/goodvibes-sdk/platform/tools/team/index';
|
|
23
|
+
import { createWorklistTool } from '@pellux/goodvibes-sdk/platform/tools/worklist/index';
|
|
24
24
|
import { createMcpTool } from './mcp/index.js';
|
|
25
25
|
import { createPacketTool } from '@pellux/goodvibes-sdk/platform/tools/packet/index';
|
|
26
26
|
import { createQueryTool } from '@pellux/goodvibes-sdk/platform/tools/query/index';
|
|
@@ -129,13 +129,13 @@ export function registerAllTools(registry, deps) {
|
|
|
129
129
|
homeDirectory: deps.configManager.getHomeDirectory() ?? undefined,
|
|
130
130
|
}));
|
|
131
131
|
registry.register(createTaskTool(sessionOrchestration));
|
|
132
|
-
registry.register(
|
|
133
|
-
registry.register(
|
|
132
|
+
registry.register(createTeamTool({ surfaceRoot: deps.surfaceRoot }));
|
|
133
|
+
registry.register(createWorklistTool({ surfaceRoot: deps.surfaceRoot }));
|
|
134
134
|
if (mcpRegistry) {
|
|
135
135
|
registry.register(createMcpTool(mcpRegistry));
|
|
136
136
|
}
|
|
137
|
-
registry.register(createPacketTool(workingDirectory));
|
|
138
|
-
registry.register(createQueryTool(workingDirectory));
|
|
137
|
+
registry.register(createPacketTool({ workingDirectory, surfaceRoot: deps.surfaceRoot }));
|
|
138
|
+
registry.register(createQueryTool({ workingDirectory, surfaceRoot: deps.surfaceRoot }));
|
|
139
139
|
if (remoteRunnerRegistry) {
|
|
140
140
|
registry.register(createRemoteTool(remoteRunnerRegistry));
|
|
141
141
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { Tool } from '../../types/tools.js';
|
|
2
|
-
export declare function createPacketTool(
|
|
2
|
+
export declare function createPacketTool(options: string | {
|
|
3
|
+
readonly workingDirectory: string;
|
|
4
|
+
readonly surfaceRoot?: string;
|
|
5
|
+
}): Tool;
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/packet/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/packet/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAkCjD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACrF,IAAI,CAyGN"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { join, resolve } from 'node:path';
|
|
3
|
+
import { resolveScopedDirectory } from '../../runtime/surface-root.js';
|
|
3
4
|
import { PACKET_TOOL_SCHEMA } from './schema.js';
|
|
4
5
|
function summarizePacket(record) {
|
|
5
6
|
return {
|
|
@@ -16,9 +17,11 @@ function summarizePacket(record) {
|
|
|
16
17
|
publishedAt: record.publishedAt,
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
export function createPacketTool(
|
|
20
|
+
export function createPacketTool(options) {
|
|
21
|
+
const workingDirectory = typeof options === 'string' ? options : options.workingDirectory;
|
|
22
|
+
const surfaceRoot = typeof options === 'string' ? undefined : options.surfaceRoot;
|
|
20
23
|
const workspaceRoot = resolve(workingDirectory);
|
|
21
|
-
const packetsDir =
|
|
24
|
+
const packetsDir = resolveScopedDirectory(workspaceRoot, surfaceRoot);
|
|
22
25
|
const packetsPath = join(packetsDir, 'packets.json');
|
|
23
26
|
function loadPackets() {
|
|
24
27
|
try {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { Tool } from '../../types/tools.js';
|
|
2
|
-
export declare function createQueryTool(
|
|
2
|
+
export declare function createQueryTool(options: string | {
|
|
3
|
+
readonly workingDirectory: string;
|
|
4
|
+
readonly surfaceRoot?: string;
|
|
5
|
+
}): Tool;
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/query/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/query/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AA8BjD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACrF,IAAI,CAmGN"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { join, resolve } from 'node:path';
|
|
3
|
+
import { resolveScopedDirectory } from '../../runtime/surface-root.js';
|
|
3
4
|
import { QUERY_TOOL_SCHEMA } from './schema.js';
|
|
4
5
|
function summarizeQuery(record) {
|
|
5
6
|
return {
|
|
@@ -14,9 +15,11 @@ function summarizeQuery(record) {
|
|
|
14
15
|
updatedAt: record.updatedAt,
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
export function createQueryTool(
|
|
18
|
+
export function createQueryTool(options) {
|
|
19
|
+
const workingDirectory = typeof options === 'string' ? options : options.workingDirectory;
|
|
20
|
+
const surfaceRoot = typeof options === 'string' ? undefined : options.surfaceRoot;
|
|
18
21
|
const workspaceRoot = resolve(workingDirectory);
|
|
19
|
-
const queriesDir =
|
|
22
|
+
const queriesDir = resolveScopedDirectory(workspaceRoot, surfaceRoot);
|
|
20
23
|
const queriesPath = join(queriesDir, 'queries.json');
|
|
21
24
|
function loadQueries() {
|
|
22
25
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/registry-tool/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAmCnD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/registry-tool/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAmCnD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AA6HD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAwC7F"}
|
|
@@ -114,20 +114,18 @@ function fuzzyFilter(items, query) {
|
|
|
114
114
|
function getSkillDirs(roots) {
|
|
115
115
|
const dirs = [
|
|
116
116
|
join(roots.workingDirectory, '.goodvibes', 'skills'),
|
|
117
|
-
join(roots.workingDirectory, '.goodvibes', 'goodvibes', 'skills'),
|
|
118
117
|
];
|
|
119
118
|
if (roots.homeDirectory) {
|
|
120
|
-
dirs.push(join(roots.homeDirectory, '.goodvibes', 'skills')
|
|
119
|
+
dirs.push(join(roots.homeDirectory, '.goodvibes', 'skills'));
|
|
121
120
|
}
|
|
122
121
|
return dirs;
|
|
123
122
|
}
|
|
124
123
|
function getAgentDirs(roots) {
|
|
125
124
|
const dirs = [
|
|
126
125
|
join(roots.workingDirectory, '.goodvibes', 'agents'),
|
|
127
|
-
join(roots.workingDirectory, '.goodvibes', 'goodvibes', 'agents'),
|
|
128
126
|
];
|
|
129
127
|
if (roots.homeDirectory) {
|
|
130
|
-
dirs.push(join(roots.homeDirectory, '.goodvibes', 'agents')
|
|
128
|
+
dirs.push(join(roots.homeDirectory, '.goodvibes', 'agents'));
|
|
131
129
|
}
|
|
132
130
|
return dirs;
|
|
133
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-loader.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/registry-tool/skill-loader.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"skill-loader.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/registry-tool/skill-loader.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAcD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAuDxF"}
|
|
@@ -10,10 +10,9 @@ import { materializeMarkdownBody, parseMarkdownFrontmatter, normalizeFrontmatter
|
|
|
10
10
|
function getSkillDirs(roots) {
|
|
11
11
|
const dirs = [
|
|
12
12
|
join(roots.workingDirectory, '.goodvibes', 'skills'),
|
|
13
|
-
join(roots.workingDirectory, '.goodvibes', 'goodvibes', 'skills'),
|
|
14
13
|
];
|
|
15
14
|
if (roots.homeDirectory) {
|
|
16
|
-
dirs.push(join(roots.homeDirectory, '.goodvibes', 'skills')
|
|
15
|
+
dirs.push(join(roots.homeDirectory, '.goodvibes', 'skills'));
|
|
17
16
|
}
|
|
18
17
|
return dirs;
|
|
19
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/team/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/team/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AA6DjD,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA+HhF;AAED,eAAO,MAAM,QAAQ,MAAmB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { resolveScopedDirectory } from '../../runtime/surface-root.js';
|
|
3
4
|
import { TEAM_TOOL_SCHEMA } from './schema.js';
|
|
4
5
|
function summarizeTeam(team) {
|
|
5
6
|
return {
|
|
@@ -12,11 +13,11 @@ function summarizeTeam(team) {
|
|
|
12
13
|
updatedAt: team.updatedAt,
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
function teamsPath(storageRoot) {
|
|
16
|
-
return
|
|
16
|
+
function teamsPath(storageRoot, surfaceRoot) {
|
|
17
|
+
return resolveScopedDirectory(storageRoot, surfaceRoot, 'teams.json');
|
|
17
18
|
}
|
|
18
|
-
function loadTeams(storageRoot) {
|
|
19
|
-
const path = teamsPath(storageRoot);
|
|
19
|
+
function loadTeams(storageRoot, surfaceRoot) {
|
|
20
|
+
const path = teamsPath(storageRoot, surfaceRoot);
|
|
20
21
|
if (!existsSync(path))
|
|
21
22
|
return [];
|
|
22
23
|
try {
|
|
@@ -27,123 +28,127 @@ function loadTeams(storageRoot) {
|
|
|
27
28
|
return [];
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
function saveTeams(storageRoot, teams) {
|
|
31
|
-
const path = teamsPath(storageRoot);
|
|
31
|
+
function saveTeams(storageRoot, teams, surfaceRoot) {
|
|
32
|
+
const path = teamsPath(storageRoot, surfaceRoot);
|
|
32
33
|
mkdirSync(dirname(path), { recursive: true });
|
|
33
34
|
writeFileSync(path, JSON.stringify({ version: 1, teams }, null, 2) + '\n', 'utf-8');
|
|
34
35
|
}
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
export function createTeamTool(options) {
|
|
37
|
+
const surfaceRoot = options?.surfaceRoot;
|
|
38
|
+
return {
|
|
39
|
+
definition: {
|
|
40
|
+
name: 'team',
|
|
41
|
+
description: 'Manage durable team definitions, roles, and communication lanes.',
|
|
42
|
+
parameters: TEAM_TOOL_SCHEMA,
|
|
43
|
+
sideEffects: ['workflow', 'state'],
|
|
44
|
+
concurrency: 'serial',
|
|
45
|
+
},
|
|
46
|
+
async execute(args) {
|
|
47
|
+
if (!args || typeof args !== 'object' || typeof args.mode !== 'string') {
|
|
48
|
+
return { success: false, error: 'Invalid args: mode is required.' };
|
|
49
|
+
}
|
|
50
|
+
const input = args;
|
|
51
|
+
if (!input.storageRoot || input.storageRoot.trim().length === 0) {
|
|
52
|
+
return { success: false, error: 'team requires storageRoot.' };
|
|
53
|
+
}
|
|
54
|
+
const teams = loadTeams(input.storageRoot, surfaceRoot);
|
|
55
|
+
const view = input.view ?? 'summary';
|
|
56
|
+
if (input.mode === 'create') {
|
|
57
|
+
if (!input.teamId || !input.name || !input.summary) {
|
|
58
|
+
return { success: false, error: 'create requires teamId, name, and summary.' };
|
|
59
|
+
}
|
|
60
|
+
if (teams.some((team) => team.id === input.teamId)) {
|
|
61
|
+
return { success: false, error: `Team already exists: ${input.teamId}` };
|
|
62
|
+
}
|
|
63
|
+
const now = Date.now();
|
|
64
|
+
const team = {
|
|
65
|
+
id: input.teamId,
|
|
66
|
+
name: input.name,
|
|
67
|
+
summary: input.summary,
|
|
68
|
+
members: [],
|
|
69
|
+
createdAt: now,
|
|
70
|
+
updatedAt: now,
|
|
71
|
+
};
|
|
72
|
+
saveTeams(input.storageRoot, [...teams, team], surfaceRoot);
|
|
73
|
+
return { success: true, output: JSON.stringify(team) };
|
|
74
|
+
}
|
|
75
|
+
if (input.mode === 'list') {
|
|
76
|
+
return {
|
|
77
|
+
success: true,
|
|
78
|
+
output: JSON.stringify({
|
|
79
|
+
view,
|
|
80
|
+
count: teams.length,
|
|
81
|
+
teams: view === 'full' ? teams : teams.map(summarizeTeam),
|
|
82
|
+
}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const index = teams.findIndex((team) => team.id === input.teamId);
|
|
86
|
+
if (index < 0) {
|
|
87
|
+
return { success: false, error: `Unknown team: ${input.teamId ?? '(missing)'}` };
|
|
56
88
|
}
|
|
57
|
-
|
|
58
|
-
|
|
89
|
+
const current = teams[index];
|
|
90
|
+
if (input.mode === 'show') {
|
|
91
|
+
return {
|
|
92
|
+
success: true,
|
|
93
|
+
output: JSON.stringify(view === 'full' ? current : {
|
|
94
|
+
...summarizeTeam(current),
|
|
95
|
+
members: current.members.map((member) => ({
|
|
96
|
+
id: member.id,
|
|
97
|
+
role: member.role,
|
|
98
|
+
lanes: member.lanes,
|
|
99
|
+
})),
|
|
100
|
+
}),
|
|
101
|
+
};
|
|
59
102
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
name: input.name,
|
|
64
|
-
summary: input.summary,
|
|
65
|
-
members: [],
|
|
66
|
-
createdAt: now,
|
|
67
|
-
updatedAt: now,
|
|
68
|
-
};
|
|
69
|
-
saveTeams(input.storageRoot, [...teams, team]);
|
|
70
|
-
return { success: true, output: JSON.stringify(team) };
|
|
71
|
-
}
|
|
72
|
-
if (input.mode === 'list') {
|
|
73
|
-
return {
|
|
74
|
-
success: true,
|
|
75
|
-
output: JSON.stringify({
|
|
76
|
-
view,
|
|
77
|
-
count: teams.length,
|
|
78
|
-
teams: view === 'full' ? teams : teams.map(summarizeTeam),
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
const index = teams.findIndex((team) => team.id === input.teamId);
|
|
83
|
-
if (index < 0) {
|
|
84
|
-
return { success: false, error: `Unknown team: ${input.teamId ?? '(missing)'}` };
|
|
85
|
-
}
|
|
86
|
-
const current = teams[index];
|
|
87
|
-
if (input.mode === 'show') {
|
|
88
|
-
return {
|
|
89
|
-
success: true,
|
|
90
|
-
output: JSON.stringify(view === 'full' ? current : {
|
|
91
|
-
...summarizeTeam(current),
|
|
92
|
-
members: current.members.map((member) => ({
|
|
93
|
-
id: member.id,
|
|
94
|
-
role: member.role,
|
|
95
|
-
lanes: member.lanes,
|
|
96
|
-
})),
|
|
97
|
-
}),
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
if (input.mode === 'delete') {
|
|
101
|
-
saveTeams(input.storageRoot, teams.filter((team) => team.id !== input.teamId));
|
|
102
|
-
return { success: true, output: JSON.stringify({ removed: input.teamId }) };
|
|
103
|
-
}
|
|
104
|
-
if (input.mode === 'add-member') {
|
|
105
|
-
if (!input.memberId || !input.role) {
|
|
106
|
-
return { success: false, error: 'add-member requires memberId and role.' };
|
|
103
|
+
if (input.mode === 'delete') {
|
|
104
|
+
saveTeams(input.storageRoot, teams.filter((team) => team.id !== input.teamId), surfaceRoot);
|
|
105
|
+
return { success: true, output: JSON.stringify({ removed: input.teamId }) };
|
|
107
106
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return { success:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return { success:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
107
|
+
if (input.mode === 'add-member') {
|
|
108
|
+
if (!input.memberId || !input.role) {
|
|
109
|
+
return { success: false, error: 'add-member requires memberId and role.' };
|
|
110
|
+
}
|
|
111
|
+
const next = {
|
|
112
|
+
...current,
|
|
113
|
+
members: [
|
|
114
|
+
...current.members.filter((member) => member.id !== input.memberId),
|
|
115
|
+
{ id: input.memberId, role: input.role, lanes: input.lanes ?? [] },
|
|
116
|
+
],
|
|
117
|
+
updatedAt: Date.now(),
|
|
118
|
+
};
|
|
119
|
+
teams[index] = next;
|
|
120
|
+
saveTeams(input.storageRoot, teams, surfaceRoot);
|
|
121
|
+
return { success: true, output: JSON.stringify(next) };
|
|
122
|
+
}
|
|
123
|
+
if (input.mode === 'remove-member') {
|
|
124
|
+
if (!input.memberId)
|
|
125
|
+
return { success: false, error: 'remove-member requires memberId.' };
|
|
126
|
+
const next = {
|
|
127
|
+
...current,
|
|
128
|
+
members: current.members.filter((member) => member.id !== input.memberId),
|
|
129
|
+
updatedAt: Date.now(),
|
|
130
|
+
};
|
|
131
|
+
teams[index] = next;
|
|
132
|
+
saveTeams(input.storageRoot, teams, surfaceRoot);
|
|
133
|
+
return { success: true, output: JSON.stringify(next) };
|
|
134
|
+
}
|
|
135
|
+
if (input.mode === 'set-lanes') {
|
|
136
|
+
if (!input.memberId)
|
|
137
|
+
return { success: false, error: 'set-lanes requires memberId.' };
|
|
138
|
+
const members = current.members.map((member) => (member.id === input.memberId
|
|
139
|
+
? { ...member, lanes: input.lanes ?? [] }
|
|
140
|
+
: member));
|
|
141
|
+
const next = {
|
|
142
|
+
...current,
|
|
143
|
+
members,
|
|
144
|
+
updatedAt: Date.now(),
|
|
145
|
+
};
|
|
146
|
+
teams[index] = next;
|
|
147
|
+
saveTeams(input.storageRoot, teams, surfaceRoot);
|
|
148
|
+
return { success: true, output: JSON.stringify(next) };
|
|
149
|
+
}
|
|
150
|
+
return { success: false, error: `Unknown mode: ${input.mode}` };
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export const teamTool = createTeamTool();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/worklist/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/worklist/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAgEjD,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA4GpF;AAED,eAAO,MAAM,YAAY,MAAuB,CAAC"}
|