@locusai/sdk 0.6.0 → 0.7.0
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/agent/worker.js +46 -5
- package/dist/ai/claude-runner.d.ts +1 -0
- package/dist/ai/claude-runner.d.ts.map +1 -1
- package/dist/index-node.js +46 -5
- package/dist/index.js +25 -2
- package/dist/modules/ai.d.ts +15 -0
- package/dist/modules/ai.d.ts.map +1 -1
- package/dist/modules/auth.d.ts +7 -1
- package/dist/modules/auth.d.ts.map +1 -1
- package/dist/modules/organizations.d.ts +3 -3
- package/dist/modules/organizations.d.ts.map +1 -1
- package/dist/modules/workspaces.d.ts +18 -0
- package/dist/modules/workspaces.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/agent/worker.js
CHANGED
|
@@ -89,7 +89,15 @@ class BaseModule {
|
|
|
89
89
|
// src/modules/ai.ts
|
|
90
90
|
class AIModule extends BaseModule {
|
|
91
91
|
async chat(workspaceId, body) {
|
|
92
|
-
const { data } = await this.api.post(`/ai/${workspaceId}/chat`, body);
|
|
92
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat`, body, { timeout: 300000 });
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
async detectIntent(workspaceId, body) {
|
|
96
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat/intent`, body, { timeout: 300000 });
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
async executeIntent(workspaceId, body) {
|
|
100
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat/execute`, body, { timeout: 300000 });
|
|
93
101
|
return data;
|
|
94
102
|
}
|
|
95
103
|
async listSessions(workspaceId) {
|
|
@@ -110,10 +118,14 @@ class AIModule extends BaseModule {
|
|
|
110
118
|
|
|
111
119
|
// src/modules/auth.ts
|
|
112
120
|
class AuthModule extends BaseModule {
|
|
113
|
-
async
|
|
121
|
+
async getProfile() {
|
|
114
122
|
const { data } = await this.api.get("/auth/me");
|
|
115
123
|
return data;
|
|
116
124
|
}
|
|
125
|
+
async getApiKeyInfo() {
|
|
126
|
+
const { data } = await this.api.get("/auth/api-key");
|
|
127
|
+
return data;
|
|
128
|
+
}
|
|
117
129
|
async requestRegisterOtp(email) {
|
|
118
130
|
const { data } = await this.api.post("/auth/register-otp", { email });
|
|
119
131
|
return data;
|
|
@@ -377,6 +389,17 @@ class WorkspacesModule extends BaseModule {
|
|
|
377
389
|
const { data } = await this.api.post(`/workspaces/${id}/dispatch`, { workerId, sprintId });
|
|
378
390
|
return data.task;
|
|
379
391
|
}
|
|
392
|
+
async listApiKeys(workspaceId) {
|
|
393
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/api-keys`);
|
|
394
|
+
return data.apiKeys;
|
|
395
|
+
}
|
|
396
|
+
async createApiKey(workspaceId, name) {
|
|
397
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/api-keys`, { name });
|
|
398
|
+
return data.apiKey;
|
|
399
|
+
}
|
|
400
|
+
async deleteApiKey(workspaceId, keyId) {
|
|
401
|
+
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
402
|
+
}
|
|
380
403
|
}
|
|
381
404
|
|
|
382
405
|
// src/index.ts
|
|
@@ -611,6 +634,7 @@ class ClaudeRunner {
|
|
|
611
634
|
let finalResult = "";
|
|
612
635
|
let errorOutput = "";
|
|
613
636
|
let buffer = "";
|
|
637
|
+
let stderrBuffer = "";
|
|
614
638
|
claude.stdout.on("data", (data) => {
|
|
615
639
|
buffer += data.toString();
|
|
616
640
|
const lines = buffer.split(`
|
|
@@ -623,14 +647,27 @@ class ClaudeRunner {
|
|
|
623
647
|
}
|
|
624
648
|
});
|
|
625
649
|
claude.stderr.on("data", (data) => {
|
|
626
|
-
const
|
|
627
|
-
errorOutput +=
|
|
628
|
-
|
|
650
|
+
const chunk = data.toString();
|
|
651
|
+
errorOutput += chunk;
|
|
652
|
+
stderrBuffer += chunk;
|
|
653
|
+
const lines = stderrBuffer.split(`
|
|
654
|
+
`);
|
|
655
|
+
stderrBuffer = lines.pop() || "";
|
|
656
|
+
for (const line of lines) {
|
|
657
|
+
if (!this.shouldSuppressLine(line)) {
|
|
658
|
+
process.stderr.write(`${line}
|
|
659
|
+
`);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
629
662
|
});
|
|
630
663
|
claude.on("error", (err) => {
|
|
631
664
|
reject(new Error(`Failed to start Claude CLI: ${err.message}. Please ensure the 'claude' command is available in your PATH.`));
|
|
632
665
|
});
|
|
633
666
|
claude.on("close", (code) => {
|
|
667
|
+
if (stderrBuffer && !this.shouldSuppressLine(stderrBuffer)) {
|
|
668
|
+
process.stderr.write(`${stderrBuffer}
|
|
669
|
+
`);
|
|
670
|
+
}
|
|
634
671
|
process.stdout.write(`
|
|
635
672
|
`);
|
|
636
673
|
if (code === 0) {
|
|
@@ -673,6 +710,10 @@ ${c.primary("[Claude]")} ${c.bold(`Running ${content_block.name}...`)}
|
|
|
673
710
|
}
|
|
674
711
|
}
|
|
675
712
|
}
|
|
713
|
+
shouldSuppressLine(line) {
|
|
714
|
+
const infoLogRegex = /^\[\d{2}:\d{2}:\d{2}\]\s\[.*?\]\sℹ\s*$/;
|
|
715
|
+
return infoLogRegex.test(line.trim());
|
|
716
|
+
}
|
|
676
717
|
createExecutionError(code, detail) {
|
|
677
718
|
const errorMsg = detail.trim();
|
|
678
719
|
const message = errorMsg ? `Claude CLI error (exit code ${code}): ${errorMsg}` : `Claude CLI exited with code ${code}. Please ensure the Claude CLI is installed and you are logged in.`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/ai/claude-runner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmB5C,qBAAa,YAAa,YAAW,QAAQ;IAKzC,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG,CAAC;IALd,OAAO,CAAC,WAAW,CAAS;gBAG1B,WAAW,EAAE,MAAM,EACX,KAAK,GAAE,MAAuC,EAC9C,GAAG,CAAC,EAAE,KAAK,YAAA;IAKf,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAyB/D,OAAO,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/ai/claude-runner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAmB5C,qBAAa,YAAa,YAAW,QAAQ;IAKzC,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG,CAAC;IALd,OAAO,CAAC,WAAW,CAAS;gBAG1B,WAAW,EAAE,MAAM,EACX,KAAK,GAAE,MAAuC,EAC9C,GAAG,CAAC,EAAE,KAAK,YAAA;IAKf,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAyB/D,OAAO,CAAC,UAAU;IAkFlB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,oBAAoB;CAO7B"}
|
package/dist/index-node.js
CHANGED
|
@@ -89,7 +89,15 @@ class BaseModule {
|
|
|
89
89
|
// src/modules/ai.ts
|
|
90
90
|
class AIModule extends BaseModule {
|
|
91
91
|
async chat(workspaceId, body) {
|
|
92
|
-
const { data } = await this.api.post(`/ai/${workspaceId}/chat`, body);
|
|
92
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat`, body, { timeout: 300000 });
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
async detectIntent(workspaceId, body) {
|
|
96
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat/intent`, body, { timeout: 300000 });
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
async executeIntent(workspaceId, body) {
|
|
100
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat/execute`, body, { timeout: 300000 });
|
|
93
101
|
return data;
|
|
94
102
|
}
|
|
95
103
|
async listSessions(workspaceId) {
|
|
@@ -110,10 +118,14 @@ class AIModule extends BaseModule {
|
|
|
110
118
|
|
|
111
119
|
// src/modules/auth.ts
|
|
112
120
|
class AuthModule extends BaseModule {
|
|
113
|
-
async
|
|
121
|
+
async getProfile() {
|
|
114
122
|
const { data } = await this.api.get("/auth/me");
|
|
115
123
|
return data;
|
|
116
124
|
}
|
|
125
|
+
async getApiKeyInfo() {
|
|
126
|
+
const { data } = await this.api.get("/auth/api-key");
|
|
127
|
+
return data;
|
|
128
|
+
}
|
|
117
129
|
async requestRegisterOtp(email) {
|
|
118
130
|
const { data } = await this.api.post("/auth/register-otp", { email });
|
|
119
131
|
return data;
|
|
@@ -377,6 +389,17 @@ class WorkspacesModule extends BaseModule {
|
|
|
377
389
|
const { data } = await this.api.post(`/workspaces/${id}/dispatch`, { workerId, sprintId });
|
|
378
390
|
return data.task;
|
|
379
391
|
}
|
|
392
|
+
async listApiKeys(workspaceId) {
|
|
393
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/api-keys`);
|
|
394
|
+
return data.apiKeys;
|
|
395
|
+
}
|
|
396
|
+
async createApiKey(workspaceId, name) {
|
|
397
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/api-keys`, { name });
|
|
398
|
+
return data.apiKey;
|
|
399
|
+
}
|
|
400
|
+
async deleteApiKey(workspaceId, keyId) {
|
|
401
|
+
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
402
|
+
}
|
|
380
403
|
}
|
|
381
404
|
|
|
382
405
|
// src/index.ts
|
|
@@ -611,6 +634,7 @@ class ClaudeRunner {
|
|
|
611
634
|
let finalResult = "";
|
|
612
635
|
let errorOutput = "";
|
|
613
636
|
let buffer = "";
|
|
637
|
+
let stderrBuffer = "";
|
|
614
638
|
claude.stdout.on("data", (data) => {
|
|
615
639
|
buffer += data.toString();
|
|
616
640
|
const lines = buffer.split(`
|
|
@@ -623,14 +647,27 @@ class ClaudeRunner {
|
|
|
623
647
|
}
|
|
624
648
|
});
|
|
625
649
|
claude.stderr.on("data", (data) => {
|
|
626
|
-
const
|
|
627
|
-
errorOutput +=
|
|
628
|
-
|
|
650
|
+
const chunk = data.toString();
|
|
651
|
+
errorOutput += chunk;
|
|
652
|
+
stderrBuffer += chunk;
|
|
653
|
+
const lines = stderrBuffer.split(`
|
|
654
|
+
`);
|
|
655
|
+
stderrBuffer = lines.pop() || "";
|
|
656
|
+
for (const line of lines) {
|
|
657
|
+
if (!this.shouldSuppressLine(line)) {
|
|
658
|
+
process.stderr.write(`${line}
|
|
659
|
+
`);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
629
662
|
});
|
|
630
663
|
claude.on("error", (err) => {
|
|
631
664
|
reject(new Error(`Failed to start Claude CLI: ${err.message}. Please ensure the 'claude' command is available in your PATH.`));
|
|
632
665
|
});
|
|
633
666
|
claude.on("close", (code) => {
|
|
667
|
+
if (stderrBuffer && !this.shouldSuppressLine(stderrBuffer)) {
|
|
668
|
+
process.stderr.write(`${stderrBuffer}
|
|
669
|
+
`);
|
|
670
|
+
}
|
|
634
671
|
process.stdout.write(`
|
|
635
672
|
`);
|
|
636
673
|
if (code === 0) {
|
|
@@ -673,6 +710,10 @@ ${c.primary("[Claude]")} ${c.bold(`Running ${content_block.name}...`)}
|
|
|
673
710
|
}
|
|
674
711
|
}
|
|
675
712
|
}
|
|
713
|
+
shouldSuppressLine(line) {
|
|
714
|
+
const infoLogRegex = /^\[\d{2}:\d{2}:\d{2}\]\s\[.*?\]\sℹ\s*$/;
|
|
715
|
+
return infoLogRegex.test(line.trim());
|
|
716
|
+
}
|
|
676
717
|
createExecutionError(code, detail) {
|
|
677
718
|
const errorMsg = detail.trim();
|
|
678
719
|
const message = errorMsg ? `Claude CLI error (exit code ${code}): ${errorMsg}` : `Claude CLI exited with code ${code}. Please ensure the Claude CLI is installed and you are logged in.`;
|
package/dist/index.js
CHANGED
|
@@ -89,7 +89,15 @@ class BaseModule {
|
|
|
89
89
|
// src/modules/ai.ts
|
|
90
90
|
class AIModule extends BaseModule {
|
|
91
91
|
async chat(workspaceId, body) {
|
|
92
|
-
const { data } = await this.api.post(`/ai/${workspaceId}/chat`, body);
|
|
92
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat`, body, { timeout: 300000 });
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
async detectIntent(workspaceId, body) {
|
|
96
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat/intent`, body, { timeout: 300000 });
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
async executeIntent(workspaceId, body) {
|
|
100
|
+
const { data } = await this.api.post(`/ai/${workspaceId}/chat/execute`, body, { timeout: 300000 });
|
|
93
101
|
return data;
|
|
94
102
|
}
|
|
95
103
|
async listSessions(workspaceId) {
|
|
@@ -110,10 +118,14 @@ class AIModule extends BaseModule {
|
|
|
110
118
|
|
|
111
119
|
// src/modules/auth.ts
|
|
112
120
|
class AuthModule extends BaseModule {
|
|
113
|
-
async
|
|
121
|
+
async getProfile() {
|
|
114
122
|
const { data } = await this.api.get("/auth/me");
|
|
115
123
|
return data;
|
|
116
124
|
}
|
|
125
|
+
async getApiKeyInfo() {
|
|
126
|
+
const { data } = await this.api.get("/auth/api-key");
|
|
127
|
+
return data;
|
|
128
|
+
}
|
|
117
129
|
async requestRegisterOtp(email) {
|
|
118
130
|
const { data } = await this.api.post("/auth/register-otp", { email });
|
|
119
131
|
return data;
|
|
@@ -377,6 +389,17 @@ class WorkspacesModule extends BaseModule {
|
|
|
377
389
|
const { data } = await this.api.post(`/workspaces/${id}/dispatch`, { workerId, sprintId });
|
|
378
390
|
return data.task;
|
|
379
391
|
}
|
|
392
|
+
async listApiKeys(workspaceId) {
|
|
393
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/api-keys`);
|
|
394
|
+
return data.apiKeys;
|
|
395
|
+
}
|
|
396
|
+
async createApiKey(workspaceId, name) {
|
|
397
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/api-keys`, { name });
|
|
398
|
+
return data.apiKey;
|
|
399
|
+
}
|
|
400
|
+
async deleteApiKey(workspaceId, keyId) {
|
|
401
|
+
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
402
|
+
}
|
|
380
403
|
}
|
|
381
404
|
|
|
382
405
|
// src/index.ts
|
package/dist/modules/ai.d.ts
CHANGED
|
@@ -5,6 +5,21 @@ export declare class AIModule extends BaseModule {
|
|
|
5
5
|
* Send a message to the Locus AI Agent and get a response.
|
|
6
6
|
*/
|
|
7
7
|
chat(workspaceId: string, body: ChatRequest): Promise<ChatResponse>;
|
|
8
|
+
/**
|
|
9
|
+
* Detect intent of the message.
|
|
10
|
+
*/
|
|
11
|
+
detectIntent(workspaceId: string, body: ChatRequest): Promise<{
|
|
12
|
+
intent: string;
|
|
13
|
+
executionId: string;
|
|
14
|
+
sessionId: string;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Execute a pending intent.
|
|
18
|
+
*/
|
|
19
|
+
executeIntent(workspaceId: string, body: {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
executionId: string;
|
|
22
|
+
}): Promise<ChatResponse>;
|
|
8
23
|
/**
|
|
9
24
|
* List all chat sessions for the current user in a workspace.
|
|
10
25
|
*/
|
package/dist/modules/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/modules/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,O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S,EAAE,MAAM,GAAG,MAAM;IAGhE;;OAEG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3E"}
|
package/dist/modules/auth.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { CompleteRegistration, LoginResponse, User, VerifyOtp } from "@locusai/shared";
|
|
2
2
|
import { BaseModule } from "./base.js";
|
|
3
3
|
export declare class AuthModule extends BaseModule {
|
|
4
|
-
|
|
4
|
+
getProfile(): Promise<User>;
|
|
5
|
+
getApiKeyInfo(): Promise<{
|
|
6
|
+
authType: string;
|
|
7
|
+
workspaceId?: string;
|
|
8
|
+
orgId?: string;
|
|
9
|
+
apiKeyName: string;
|
|
10
|
+
}>;
|
|
5
11
|
requestRegisterOtp(email: string): Promise<{
|
|
6
12
|
success: boolean;
|
|
7
13
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/modules/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,IAAI,EACJ,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,UAAW,SAAQ,UAAU;IAClC,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/modules/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,IAAI,EACJ,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,UAAW,SAAQ,UAAU;IAClC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,aAAa,IAAI,OAAO,CAAC;QAC7B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAKI,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAQhE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAQ7D,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC;IAQpD,oBAAoB,CACxB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,aAAa,CAAC;CAO1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AddMember, MembershipWithUser, Organization } from "@locusai/shared";
|
|
2
2
|
import { BaseModule } from "./base.js";
|
|
3
|
-
export interface
|
|
3
|
+
export interface OrganizationApiKey {
|
|
4
4
|
id: string;
|
|
5
5
|
organizationId: string;
|
|
6
6
|
name: string;
|
|
@@ -17,8 +17,8 @@ export declare class OrganizationsModule extends BaseModule {
|
|
|
17
17
|
addMember(id: string, body: AddMember): Promise<MembershipWithUser>;
|
|
18
18
|
removeMember(orgId: string, userId: string): Promise<void>;
|
|
19
19
|
delete(orgId: string): Promise<void>;
|
|
20
|
-
listApiKeys(orgId: string): Promise<
|
|
21
|
-
createApiKey(orgId: string, name: string): Promise<
|
|
20
|
+
listApiKeys(orgId: string): Promise<OrganizationApiKey[]>;
|
|
21
|
+
createApiKey(orgId: string, name: string): Promise<OrganizationApiKey>;
|
|
22
22
|
deleteApiKey(orgId: string, keyId: string): Promise<void>;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=organizations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/modules/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,kBAAkB,EAElB,YAAY,EA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IAQtE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhE"}
|
|
@@ -12,10 +12,28 @@ export declare class WorkspacesModule extends BaseModule {
|
|
|
12
12
|
delete(id: string): Promise<void>;
|
|
13
13
|
getStats(id: string): Promise<WorkspaceStats>;
|
|
14
14
|
getActivity(id: string, limit?: number): Promise<Event[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Dispatch a task from the workspace backlog to an agent.
|
|
17
|
+
* Atomically moves a task from BACKLOG to IN_PROGRESS and assigns it.
|
|
18
|
+
*/
|
|
15
19
|
/**
|
|
16
20
|
* Dispatch a task from the workspace backlog to an agent.
|
|
17
21
|
* Atomically moves a task from BACKLOG to IN_PROGRESS and assigns it.
|
|
18
22
|
*/
|
|
19
23
|
dispatch(id: string, workerId: string, sprintId?: string): Promise<Task>;
|
|
24
|
+
listApiKeys(workspaceId: string): Promise<WorkspaceApiKey[]>;
|
|
25
|
+
createApiKey(workspaceId: string, name: string): Promise<WorkspaceApiKey>;
|
|
26
|
+
deleteApiKey(workspaceId: string, keyId: string): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkspaceApiKey {
|
|
29
|
+
id: string;
|
|
30
|
+
organizationId?: string | null;
|
|
31
|
+
workspaceId?: string | null;
|
|
32
|
+
name: string;
|
|
33
|
+
key: string;
|
|
34
|
+
active: boolean;
|
|
35
|
+
lastUsedAt: string | null;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
20
38
|
}
|
|
21
39
|
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/modules/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,KAAK,EACL,IAAI,EAEJ,eAAe,EACf,SAAS,EAET,cAAc,EAEf,MAAM,iBAAiB,CAAC;AACzB,O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I,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"clean": "rm -rf node_modules"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@locusai/shared": "^0.
|
|
33
|
+
"@locusai/shared": "^0.7.0",
|
|
34
34
|
"axios": "^1.13.2",
|
|
35
35
|
"events": "^3.3.0",
|
|
36
36
|
"globby": "^14.0.2"
|