@agentuity/task 1.0.54
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/AGENTS.md +40 -0
- package/README.md +59 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
- package/src/index.ts +256 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Agent Guidelines for @agentuity/task
|
|
2
|
+
|
|
3
|
+
## Package Overview
|
|
4
|
+
|
|
5
|
+
Standalone package for the Agentuity Task service. Provides a simple, ergonomic client for managing tasks, comments, tags, and attachments in a lightweight task tracking system.
|
|
6
|
+
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
- **Build**: `bun run build`
|
|
10
|
+
- **Typecheck**: `bun run typecheck`
|
|
11
|
+
- **Clean**: `rm -rf dist`
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
- **Runtime**: Node.js and Bun compatible
|
|
16
|
+
- **Exports**: TaskClient and all types from @agentuity/core/task
|
|
17
|
+
- **Dependencies**: @agentuity/core, @agentuity/server, zod
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { TaskClient } from '@agentuity/task';
|
|
23
|
+
|
|
24
|
+
const client = new TaskClient();
|
|
25
|
+
|
|
26
|
+
// Create a task
|
|
27
|
+
const task = await client.create({
|
|
28
|
+
title: 'Implement feature',
|
|
29
|
+
description: 'Add new feature to the system',
|
|
30
|
+
priority: 'high'
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Add a comment
|
|
34
|
+
await client.createComment(task.id, 'Started working on this');
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Publishing
|
|
38
|
+
|
|
39
|
+
1. Run `bun run build`
|
|
40
|
+
2. Must publish **after** @agentuity/core
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @agentuity/task
|
|
2
|
+
|
|
3
|
+
A standalone package for the Agentuity Task service - a lightweight task tracking system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @agentuity/task
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { TaskClient } from '@agentuity/task';
|
|
15
|
+
|
|
16
|
+
const client = new TaskClient();
|
|
17
|
+
|
|
18
|
+
// Create a task
|
|
19
|
+
const task = await client.create({
|
|
20
|
+
title: 'Implement new feature',
|
|
21
|
+
description: 'Add support for batch operations',
|
|
22
|
+
priority: 'high',
|
|
23
|
+
type: 'feature'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
console.log('Created task:', task.id);
|
|
27
|
+
|
|
28
|
+
// Add a comment
|
|
29
|
+
await client.createComment(task.id, 'Started working on this task');
|
|
30
|
+
|
|
31
|
+
// Create and assign tags
|
|
32
|
+
const tag = await client.createTag('backend', '#3366cc');
|
|
33
|
+
await client.addTagToTask(task.id, tag.id);
|
|
34
|
+
|
|
35
|
+
// List tasks
|
|
36
|
+
const { tasks, total } = await client.list({ status: 'open' });
|
|
37
|
+
console.log(`Found ${total} open tasks`);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const client = new TaskClient({
|
|
44
|
+
apiKey: 'your-api-key',
|
|
45
|
+
url: 'https://api.agentuity.com',
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Environment Variables
|
|
50
|
+
|
|
51
|
+
| Variable | Description | Default |
|
|
52
|
+
|----------|-------------|---------|
|
|
53
|
+
| `AGENTUITY_SDK_KEY` | API key for authentication | Required |
|
|
54
|
+
| `AGENTUITY_REGION` | Region for API endpoints | `usc` |
|
|
55
|
+
| `AGENTUITY_TASK_URL` | Override Task API URL | Auto-detected |
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
Apache-2.0
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export { TaskStorageService, type Task, type Comment, type Tag, type TaskChangelogEntry, type TaskChangelogResult, type CreateTaskParams, type UpdateTaskParams, type ListTasksParams, type ListTasksResult, type BatchDeleteTasksParams, type BatchDeleteTasksResult, type CreateUserParams, type CreateProjectParams, type ListCommentsResult, type ListTagsResult, type Attachment, type CreateAttachmentParams, type PresignUploadResponse, type PresignDownloadResponse, type ListAttachmentsResult, type ListUsersResult, type ListProjectsResult, type TaskActivityParams, type TaskActivityResult, type TaskPriority, type TaskType, type TaskStatus, type EntityRef, type UserEntityRef, type UserType, TaskSchema, TaskPrioritySchema, TaskTypeSchema, TaskStatusSchema, EntityRefSchema, UserTypeSchema, UserEntityRefSchema, CommentSchema, TagSchema, TaskChangelogEntrySchema, CreateTaskParamsSchema, UpdateTaskParamsSchema, ListTasksParamsSchema, ListTasksResultSchema, BatchDeleteTasksParamsSchema, BatchDeleteTasksResultSchema, TaskChangelogResultSchema, ListCommentsResultSchema, ListTagsResultSchema, AttachmentSchema, CreateAttachmentParamsSchema, PresignUploadResponseSchema, PresignDownloadResponseSchema, ListAttachmentsResultSchema, ListUsersResultSchema, ListProjectsResultSchema, TaskActivityParamsSchema, TaskActivityResultSchema, normalizeTaskStatus, } from '@agentuity/core/task';
|
|
2
|
+
import { type CreateTaskParams, type UpdateTaskParams, type ListTasksParams, type ListTasksResult, type Task, type Comment, type Tag, type TaskChangelogResult, type ListCommentsResult, type CreateAttachmentParams, type PresignUploadResponse, type PresignDownloadResponse, type ListAttachmentsResult, type ListUsersResult, type ListProjectsResult, type TaskActivityResult, type TaskActivityParams, type Attachment, type EntityRef } from '@agentuity/core/task';
|
|
3
|
+
import { type Logger } from '@agentuity/server';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const TaskClientOptionsSchema: z.ZodObject<{
|
|
6
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
7
|
+
url: z.ZodOptional<z.ZodString>;
|
|
8
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
logger: z.ZodOptional<z.ZodCustom<Logger, Logger>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type TaskClientOptions = z.infer<typeof TaskClientOptionsSchema>;
|
|
12
|
+
export declare class TaskClient {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(options?: TaskClientOptions);
|
|
15
|
+
create(params: CreateTaskParams): Promise<Task>;
|
|
16
|
+
get(id: string): Promise<Task | null>;
|
|
17
|
+
list(params?: ListTasksParams): Promise<ListTasksResult>;
|
|
18
|
+
update(id: string, params: UpdateTaskParams): Promise<Task>;
|
|
19
|
+
close(id: string): Promise<Task>;
|
|
20
|
+
softDelete(id: string): Promise<Task>;
|
|
21
|
+
changelog(id: string, params?: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}): Promise<TaskChangelogResult>;
|
|
25
|
+
createComment(taskId: string, body: string, userId: string, author?: EntityRef): Promise<Comment>;
|
|
26
|
+
getComment(commentId: string): Promise<Comment | null>;
|
|
27
|
+
updateComment(commentId: string, body: string): Promise<Comment>;
|
|
28
|
+
deleteComment(commentId: string): Promise<void>;
|
|
29
|
+
listComments(taskId: string, params?: {
|
|
30
|
+
limit?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
}): Promise<ListCommentsResult>;
|
|
33
|
+
createTag(name: string, color?: string): Promise<Tag>;
|
|
34
|
+
getTag(tagId: string): Promise<Tag | null>;
|
|
35
|
+
updateTag(tagId: string, name: string, color?: string): Promise<Tag>;
|
|
36
|
+
deleteTag(tagId: string): Promise<void>;
|
|
37
|
+
listTags(): Promise<Tag[]>;
|
|
38
|
+
addTagToTask(taskId: string, tagId: string): Promise<void>;
|
|
39
|
+
removeTagFromTask(taskId: string, tagId: string): Promise<void>;
|
|
40
|
+
listTagsForTask(taskId: string): Promise<Tag[]>;
|
|
41
|
+
uploadAttachment(taskId: string, params: CreateAttachmentParams): Promise<PresignUploadResponse>;
|
|
42
|
+
confirmAttachment(attachmentId: string): Promise<Attachment>;
|
|
43
|
+
downloadAttachment(attachmentId: string): Promise<PresignDownloadResponse>;
|
|
44
|
+
listAttachments(taskId: string): Promise<ListAttachmentsResult>;
|
|
45
|
+
deleteAttachment(attachmentId: string): Promise<void>;
|
|
46
|
+
listUsers(): Promise<ListUsersResult>;
|
|
47
|
+
listProjects(): Promise<ListProjectsResult>;
|
|
48
|
+
getActivity(params?: TaskActivityParams): Promise<TaskActivityResult>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB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AAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpE,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAK1B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1D,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAI/C,gBAAgB,CACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,sBAAsB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IAI3B,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI5D,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAI1E,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI/D,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAIrC,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAI3C,WAAW,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG3E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export { TaskStorageService, TaskSchema, TaskPrioritySchema, TaskTypeSchema, TaskStatusSchema, EntityRefSchema, UserTypeSchema, UserEntityRefSchema, CommentSchema, TagSchema, TaskChangelogEntrySchema, CreateTaskParamsSchema, UpdateTaskParamsSchema, ListTasksParamsSchema, ListTasksResultSchema, BatchDeleteTasksParamsSchema, BatchDeleteTasksResultSchema, TaskChangelogResultSchema, ListCommentsResultSchema, ListTagsResultSchema, AttachmentSchema, CreateAttachmentParamsSchema, PresignUploadResponseSchema, PresignDownloadResponseSchema, ListAttachmentsResultSchema, ListUsersResultSchema, ListProjectsResultSchema, TaskActivityParamsSchema, TaskActivityResultSchema, normalizeTaskStatus, } from '@agentuity/core/task';
|
|
2
|
+
import { TaskStorageService, } from '@agentuity/core/task';
|
|
3
|
+
import { createServerFetchAdapter, buildClientHeaders } from '@agentuity/server';
|
|
4
|
+
import { createMinimalLogger } from '@agentuity/core';
|
|
5
|
+
import { getEnv } from '@agentuity/core';
|
|
6
|
+
import { getServiceUrls } from '@agentuity/core/config';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
const isLogger = (val) => typeof val === 'object' &&
|
|
9
|
+
val !== null &&
|
|
10
|
+
['info', 'warn', 'error', 'debug', 'trace'].every((m) => typeof val[m] === 'function');
|
|
11
|
+
export const TaskClientOptionsSchema = z.object({
|
|
12
|
+
apiKey: z.string().optional().describe('API key for authentication'),
|
|
13
|
+
url: z.string().optional().describe('Base URL for the Task API'),
|
|
14
|
+
orgId: z.string().optional().describe('Organization ID for multi-tenant operations'),
|
|
15
|
+
logger: z.custom(isLogger).optional().describe('Custom logger instance'),
|
|
16
|
+
});
|
|
17
|
+
export class TaskClient {
|
|
18
|
+
#service;
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
const validatedOptions = TaskClientOptionsSchema.parse(options);
|
|
21
|
+
const apiKey = validatedOptions.apiKey || getEnv('AGENTUITY_SDK_KEY') || getEnv('AGENTUITY_CLI_KEY');
|
|
22
|
+
const region = getEnv('AGENTUITY_REGION') ?? 'usc';
|
|
23
|
+
const serviceUrls = getServiceUrls(region);
|
|
24
|
+
const url = validatedOptions.url || getEnv('AGENTUITY_TASK_URL') || serviceUrls.catalyst;
|
|
25
|
+
const logger = validatedOptions.logger ?? createMinimalLogger();
|
|
26
|
+
const headers = buildClientHeaders({
|
|
27
|
+
apiKey,
|
|
28
|
+
orgId: validatedOptions.orgId,
|
|
29
|
+
});
|
|
30
|
+
const adapter = createServerFetchAdapter({ headers }, logger);
|
|
31
|
+
this.#service = new TaskStorageService(url, adapter);
|
|
32
|
+
}
|
|
33
|
+
async create(params) {
|
|
34
|
+
return this.#service.create(params);
|
|
35
|
+
}
|
|
36
|
+
async get(id) {
|
|
37
|
+
return this.#service.get(id);
|
|
38
|
+
}
|
|
39
|
+
async list(params) {
|
|
40
|
+
return this.#service.list(params);
|
|
41
|
+
}
|
|
42
|
+
async update(id, params) {
|
|
43
|
+
return this.#service.update(id, params);
|
|
44
|
+
}
|
|
45
|
+
async close(id) {
|
|
46
|
+
return this.#service.close(id);
|
|
47
|
+
}
|
|
48
|
+
async softDelete(id) {
|
|
49
|
+
return this.#service.softDelete(id);
|
|
50
|
+
}
|
|
51
|
+
async changelog(id, params) {
|
|
52
|
+
return this.#service.changelog(id, params);
|
|
53
|
+
}
|
|
54
|
+
async createComment(taskId, body, userId, author) {
|
|
55
|
+
return this.#service.createComment(taskId, body, userId, author);
|
|
56
|
+
}
|
|
57
|
+
async getComment(commentId) {
|
|
58
|
+
return this.#service.getComment(commentId);
|
|
59
|
+
}
|
|
60
|
+
async updateComment(commentId, body) {
|
|
61
|
+
return this.#service.updateComment(commentId, body);
|
|
62
|
+
}
|
|
63
|
+
async deleteComment(commentId) {
|
|
64
|
+
return this.#service.deleteComment(commentId);
|
|
65
|
+
}
|
|
66
|
+
async listComments(taskId, params) {
|
|
67
|
+
return this.#service.listComments(taskId, params);
|
|
68
|
+
}
|
|
69
|
+
async createTag(name, color) {
|
|
70
|
+
return this.#service.createTag(name, color);
|
|
71
|
+
}
|
|
72
|
+
async getTag(tagId) {
|
|
73
|
+
return this.#service.getTag(tagId);
|
|
74
|
+
}
|
|
75
|
+
async updateTag(tagId, name, color) {
|
|
76
|
+
return this.#service.updateTag(tagId, name, color);
|
|
77
|
+
}
|
|
78
|
+
async deleteTag(tagId) {
|
|
79
|
+
return this.#service.deleteTag(tagId);
|
|
80
|
+
}
|
|
81
|
+
async listTags() {
|
|
82
|
+
const result = await this.#service.listTags();
|
|
83
|
+
return result.tags;
|
|
84
|
+
}
|
|
85
|
+
async addTagToTask(taskId, tagId) {
|
|
86
|
+
return this.#service.addTagToTask(taskId, tagId);
|
|
87
|
+
}
|
|
88
|
+
async removeTagFromTask(taskId, tagId) {
|
|
89
|
+
return this.#service.removeTagFromTask(taskId, tagId);
|
|
90
|
+
}
|
|
91
|
+
async listTagsForTask(taskId) {
|
|
92
|
+
return this.#service.listTagsForTask(taskId);
|
|
93
|
+
}
|
|
94
|
+
async uploadAttachment(taskId, params) {
|
|
95
|
+
return this.#service.uploadAttachment(taskId, params);
|
|
96
|
+
}
|
|
97
|
+
async confirmAttachment(attachmentId) {
|
|
98
|
+
return this.#service.confirmAttachment(attachmentId);
|
|
99
|
+
}
|
|
100
|
+
async downloadAttachment(attachmentId) {
|
|
101
|
+
return this.#service.downloadAttachment(attachmentId);
|
|
102
|
+
}
|
|
103
|
+
async listAttachments(taskId) {
|
|
104
|
+
return this.#service.listAttachments(taskId);
|
|
105
|
+
}
|
|
106
|
+
async deleteAttachment(attachmentId) {
|
|
107
|
+
return this.#service.deleteAttachment(attachmentId);
|
|
108
|
+
}
|
|
109
|
+
async listUsers() {
|
|
110
|
+
return this.#service.listUsers();
|
|
111
|
+
}
|
|
112
|
+
async listProjects() {
|
|
113
|
+
return this.#service.listProjects();
|
|
114
|
+
}
|
|
115
|
+
async getActivity(params) {
|
|
116
|
+
return this.#service.getActivity(params);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EA+BlB,UAAU,EACV,kBAAkB,EAClB,c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,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,gBAAgB,CACrB,MAAc,EACd,MAA8B;QAE9B,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,YAAoB;QAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,YAAoB;QAC5C,OAAO,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAc;QACnC,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,YAAoB;QAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,SAAS;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,YAAY;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAA2B;QAC5C,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;CACD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentuity/task",
|
|
3
|
+
"version": "1.0.54",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"author": "Agentuity employees and contributors",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"AGENTS.md",
|
|
11
|
+
"README.md",
|
|
12
|
+
"src",
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
23
|
+
"build": "bunx tsc --build --force",
|
|
24
|
+
"typecheck": "bunx tsc --noEmit",
|
|
25
|
+
"prepublishOnly": "bun run clean && bun run build"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@agentuity/core": "1.0.54",
|
|
29
|
+
"@agentuity/server": "1.0.54",
|
|
30
|
+
"zod": "^4.3.5"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/bun": "latest",
|
|
34
|
+
"@types/node": "^22.0.0",
|
|
35
|
+
"bun-types": "latest",
|
|
36
|
+
"typescript": "^5.9.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"sideEffects": false
|
|
42
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
export {
|
|
2
|
+
TaskStorageService,
|
|
3
|
+
type Task,
|
|
4
|
+
type Comment,
|
|
5
|
+
type Tag,
|
|
6
|
+
type TaskChangelogEntry,
|
|
7
|
+
type TaskChangelogResult,
|
|
8
|
+
type CreateTaskParams,
|
|
9
|
+
type UpdateTaskParams,
|
|
10
|
+
type ListTasksParams,
|
|
11
|
+
type ListTasksResult,
|
|
12
|
+
type BatchDeleteTasksParams,
|
|
13
|
+
type BatchDeleteTasksResult,
|
|
14
|
+
type CreateUserParams,
|
|
15
|
+
type CreateProjectParams,
|
|
16
|
+
type ListCommentsResult,
|
|
17
|
+
type ListTagsResult,
|
|
18
|
+
type Attachment,
|
|
19
|
+
type CreateAttachmentParams,
|
|
20
|
+
type PresignUploadResponse,
|
|
21
|
+
type PresignDownloadResponse,
|
|
22
|
+
type ListAttachmentsResult,
|
|
23
|
+
type ListUsersResult,
|
|
24
|
+
type ListProjectsResult,
|
|
25
|
+
type TaskActivityParams,
|
|
26
|
+
type TaskActivityResult,
|
|
27
|
+
type TaskPriority,
|
|
28
|
+
type TaskType,
|
|
29
|
+
type TaskStatus,
|
|
30
|
+
type EntityRef,
|
|
31
|
+
type UserEntityRef,
|
|
32
|
+
type UserType,
|
|
33
|
+
TaskSchema,
|
|
34
|
+
TaskPrioritySchema,
|
|
35
|
+
TaskTypeSchema,
|
|
36
|
+
TaskStatusSchema,
|
|
37
|
+
EntityRefSchema,
|
|
38
|
+
UserTypeSchema,
|
|
39
|
+
UserEntityRefSchema,
|
|
40
|
+
CommentSchema,
|
|
41
|
+
TagSchema,
|
|
42
|
+
TaskChangelogEntrySchema,
|
|
43
|
+
CreateTaskParamsSchema,
|
|
44
|
+
UpdateTaskParamsSchema,
|
|
45
|
+
ListTasksParamsSchema,
|
|
46
|
+
ListTasksResultSchema,
|
|
47
|
+
BatchDeleteTasksParamsSchema,
|
|
48
|
+
BatchDeleteTasksResultSchema,
|
|
49
|
+
TaskChangelogResultSchema,
|
|
50
|
+
ListCommentsResultSchema,
|
|
51
|
+
ListTagsResultSchema,
|
|
52
|
+
AttachmentSchema,
|
|
53
|
+
CreateAttachmentParamsSchema,
|
|
54
|
+
PresignUploadResponseSchema,
|
|
55
|
+
PresignDownloadResponseSchema,
|
|
56
|
+
ListAttachmentsResultSchema,
|
|
57
|
+
ListUsersResultSchema,
|
|
58
|
+
ListProjectsResultSchema,
|
|
59
|
+
TaskActivityParamsSchema,
|
|
60
|
+
TaskActivityResultSchema,
|
|
61
|
+
normalizeTaskStatus,
|
|
62
|
+
} from '@agentuity/core/task';
|
|
63
|
+
|
|
64
|
+
import {
|
|
65
|
+
TaskStorageService,
|
|
66
|
+
type CreateTaskParams,
|
|
67
|
+
type UpdateTaskParams,
|
|
68
|
+
type ListTasksParams,
|
|
69
|
+
type ListTasksResult,
|
|
70
|
+
type Task,
|
|
71
|
+
type Comment,
|
|
72
|
+
type Tag,
|
|
73
|
+
type TaskChangelogResult,
|
|
74
|
+
type ListCommentsResult,
|
|
75
|
+
type CreateAttachmentParams,
|
|
76
|
+
type PresignUploadResponse,
|
|
77
|
+
type PresignDownloadResponse,
|
|
78
|
+
type ListAttachmentsResult,
|
|
79
|
+
type ListUsersResult,
|
|
80
|
+
type ListProjectsResult,
|
|
81
|
+
type TaskActivityResult,
|
|
82
|
+
type TaskActivityParams,
|
|
83
|
+
type Attachment,
|
|
84
|
+
type EntityRef,
|
|
85
|
+
} from '@agentuity/core/task';
|
|
86
|
+
import { createServerFetchAdapter, buildClientHeaders, type Logger } from '@agentuity/server';
|
|
87
|
+
import { createMinimalLogger } from '@agentuity/core';
|
|
88
|
+
import { getEnv } from '@agentuity/core';
|
|
89
|
+
import { getServiceUrls } from '@agentuity/core/config';
|
|
90
|
+
import { z } from 'zod';
|
|
91
|
+
|
|
92
|
+
const isLogger = (val: unknown): val is Logger =>
|
|
93
|
+
typeof val === 'object' &&
|
|
94
|
+
val !== null &&
|
|
95
|
+
['info', 'warn', 'error', 'debug', 'trace'].every(
|
|
96
|
+
(m) => typeof (val as Record<string, unknown>)[m] === 'function'
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
export const TaskClientOptionsSchema = z.object({
|
|
100
|
+
apiKey: z.string().optional().describe('API key for authentication'),
|
|
101
|
+
url: z.string().optional().describe('Base URL for the Task API'),
|
|
102
|
+
orgId: z.string().optional().describe('Organization ID for multi-tenant operations'),
|
|
103
|
+
logger: z.custom<Logger>(isLogger).optional().describe('Custom logger instance'),
|
|
104
|
+
});
|
|
105
|
+
export type TaskClientOptions = z.infer<typeof TaskClientOptionsSchema>;
|
|
106
|
+
|
|
107
|
+
export class TaskClient {
|
|
108
|
+
readonly #service: TaskStorageService;
|
|
109
|
+
|
|
110
|
+
constructor(options: TaskClientOptions = {}) {
|
|
111
|
+
const validatedOptions = TaskClientOptionsSchema.parse(options);
|
|
112
|
+
const apiKey =
|
|
113
|
+
validatedOptions.apiKey || getEnv('AGENTUITY_SDK_KEY') || getEnv('AGENTUITY_CLI_KEY');
|
|
114
|
+
const region = getEnv('AGENTUITY_REGION') ?? 'usc';
|
|
115
|
+
const serviceUrls = getServiceUrls(region);
|
|
116
|
+
|
|
117
|
+
const url = validatedOptions.url || getEnv('AGENTUITY_TASK_URL') || serviceUrls.catalyst;
|
|
118
|
+
|
|
119
|
+
const logger = validatedOptions.logger ?? createMinimalLogger();
|
|
120
|
+
|
|
121
|
+
const headers = buildClientHeaders({
|
|
122
|
+
apiKey,
|
|
123
|
+
orgId: validatedOptions.orgId,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const adapter = createServerFetchAdapter({ headers }, logger);
|
|
127
|
+
this.#service = new TaskStorageService(url, adapter);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async create(params: CreateTaskParams): Promise<Task> {
|
|
131
|
+
return this.#service.create(params);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async get(id: string): Promise<Task | null> {
|
|
135
|
+
return this.#service.get(id);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async list(params?: ListTasksParams): Promise<ListTasksResult> {
|
|
139
|
+
return this.#service.list(params);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async update(id: string, params: UpdateTaskParams): Promise<Task> {
|
|
143
|
+
return this.#service.update(id, params);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async close(id: string): Promise<Task> {
|
|
147
|
+
return this.#service.close(id);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async softDelete(id: string): Promise<Task> {
|
|
151
|
+
return this.#service.softDelete(id);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async changelog(
|
|
155
|
+
id: string,
|
|
156
|
+
params?: { limit?: number; offset?: number }
|
|
157
|
+
): Promise<TaskChangelogResult> {
|
|
158
|
+
return this.#service.changelog(id, params);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async createComment(
|
|
162
|
+
taskId: string,
|
|
163
|
+
body: string,
|
|
164
|
+
userId: string,
|
|
165
|
+
author?: EntityRef
|
|
166
|
+
): Promise<Comment> {
|
|
167
|
+
return this.#service.createComment(taskId, body, userId, author);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async getComment(commentId: string): Promise<Comment | null> {
|
|
171
|
+
return this.#service.getComment(commentId);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async updateComment(commentId: string, body: string): Promise<Comment> {
|
|
175
|
+
return this.#service.updateComment(commentId, body);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
async deleteComment(commentId: string): Promise<void> {
|
|
179
|
+
return this.#service.deleteComment(commentId);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async listComments(
|
|
183
|
+
taskId: string,
|
|
184
|
+
params?: { limit?: number; offset?: number }
|
|
185
|
+
): Promise<ListCommentsResult> {
|
|
186
|
+
return this.#service.listComments(taskId, params);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async createTag(name: string, color?: string): Promise<Tag> {
|
|
190
|
+
return this.#service.createTag(name, color);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async getTag(tagId: string): Promise<Tag | null> {
|
|
194
|
+
return this.#service.getTag(tagId);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
async updateTag(tagId: string, name: string, color?: string): Promise<Tag> {
|
|
198
|
+
return this.#service.updateTag(tagId, name, color);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
async deleteTag(tagId: string): Promise<void> {
|
|
202
|
+
return this.#service.deleteTag(tagId);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async listTags(): Promise<Tag[]> {
|
|
206
|
+
const result = await this.#service.listTags();
|
|
207
|
+
return result.tags;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async addTagToTask(taskId: string, tagId: string): Promise<void> {
|
|
211
|
+
return this.#service.addTagToTask(taskId, tagId);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async removeTagFromTask(taskId: string, tagId: string): Promise<void> {
|
|
215
|
+
return this.#service.removeTagFromTask(taskId, tagId);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async listTagsForTask(taskId: string): Promise<Tag[]> {
|
|
219
|
+
return this.#service.listTagsForTask(taskId);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async uploadAttachment(
|
|
223
|
+
taskId: string,
|
|
224
|
+
params: CreateAttachmentParams
|
|
225
|
+
): Promise<PresignUploadResponse> {
|
|
226
|
+
return this.#service.uploadAttachment(taskId, params);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
async confirmAttachment(attachmentId: string): Promise<Attachment> {
|
|
230
|
+
return this.#service.confirmAttachment(attachmentId);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
async downloadAttachment(attachmentId: string): Promise<PresignDownloadResponse> {
|
|
234
|
+
return this.#service.downloadAttachment(attachmentId);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async listAttachments(taskId: string): Promise<ListAttachmentsResult> {
|
|
238
|
+
return this.#service.listAttachments(taskId);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
async deleteAttachment(attachmentId: string): Promise<void> {
|
|
242
|
+
return this.#service.deleteAttachment(attachmentId);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
async listUsers(): Promise<ListUsersResult> {
|
|
246
|
+
return this.#service.listUsers();
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
async listProjects(): Promise<ListProjectsResult> {
|
|
250
|
+
return this.#service.listProjects();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async getActivity(params?: TaskActivityParams): Promise<TaskActivityResult> {
|
|
254
|
+
return this.#service.getActivity(params);
|
|
255
|
+
}
|
|
256
|
+
}
|