@acontext/acontext 0.1.4 → 0.1.5
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/client.d.ts +0 -2
- package/dist/client.js +0 -2
- package/dist/resources/index.d.ts +0 -1
- package/dist/resources/index.js +0 -1
- package/dist/resources/sessions.d.ts +12 -0
- package/dist/resources/sessions.js +14 -0
- package/dist/types/common.d.ts +5 -0
- package/dist/types/common.js +5 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/package.json +1 -1
- package/dist/resources/tools.d.ts +0 -13
- package/dist/resources/tools.js +0 -26
- package/dist/types/tool.d.ts +0 -19
- package/dist/types/tool.js +0 -19
package/dist/client.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { DisksAPI } from './resources/disks';
|
|
5
5
|
import { SandboxesAPI } from './resources/sandboxes';
|
|
6
6
|
import { SessionsAPI } from './resources/sessions';
|
|
7
|
-
import { ToolsAPI } from './resources/tools';
|
|
8
7
|
import { SkillsAPI } from './resources/skills';
|
|
9
8
|
import { UsersAPI } from './resources/users';
|
|
10
9
|
import { RequesterProtocol } from './client-types';
|
|
@@ -22,7 +21,6 @@ export declare class AcontextClient implements RequesterProtocol {
|
|
|
22
21
|
sessions: SessionsAPI;
|
|
23
22
|
disks: DisksAPI;
|
|
24
23
|
artifacts: DisksAPI['artifacts'];
|
|
25
|
-
tools: ToolsAPI;
|
|
26
24
|
skills: SkillsAPI;
|
|
27
25
|
users: UsersAPI;
|
|
28
26
|
sandboxes: SandboxesAPI;
|
package/dist/client.js
CHANGED
|
@@ -41,7 +41,6 @@ const errors_1 = require("./errors");
|
|
|
41
41
|
const disks_1 = require("./resources/disks");
|
|
42
42
|
const sandboxes_1 = require("./resources/sandboxes");
|
|
43
43
|
const sessions_1 = require("./resources/sessions");
|
|
44
|
-
const tools_1 = require("./resources/tools");
|
|
45
44
|
const skills_1 = require("./resources/skills");
|
|
46
45
|
const users_1 = require("./resources/users");
|
|
47
46
|
const constants_1 = require("./constants");
|
|
@@ -75,7 +74,6 @@ class AcontextClient {
|
|
|
75
74
|
this.sessions = new sessions_1.SessionsAPI(this);
|
|
76
75
|
this.disks = new disks_1.DisksAPI(this);
|
|
77
76
|
this.artifacts = this.disks.artifacts;
|
|
78
|
-
this.tools = new tools_1.ToolsAPI(this);
|
|
79
77
|
this.skills = new skills_1.SkillsAPI(this);
|
|
80
78
|
this.users = new users_1.UsersAPI(this);
|
|
81
79
|
this.sandboxes = new sandboxes_1.SandboxesAPI(this);
|
package/dist/resources/index.js
CHANGED
|
@@ -19,7 +19,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
__exportStar(require("./sessions"), exports);
|
|
21
21
|
__exportStar(require("./disks"), exports);
|
|
22
|
-
__exportStar(require("./tools"), exports);
|
|
23
22
|
__exportStar(require("./skills"), exports);
|
|
24
23
|
__exportStar(require("./sandboxes"), exports);
|
|
25
24
|
__exportStar(require("./users"), exports);
|
|
@@ -30,10 +30,22 @@ export declare class SessionsAPI {
|
|
|
30
30
|
timeDesc?: boolean | null;
|
|
31
31
|
filterByConfigs?: Record<string, unknown> | null;
|
|
32
32
|
}): Promise<ListSessionsOutput>;
|
|
33
|
+
/**
|
|
34
|
+
* Create a new session.
|
|
35
|
+
*
|
|
36
|
+
* @param options - Options for creating a session.
|
|
37
|
+
* @param options.user - Optional user identifier string.
|
|
38
|
+
* @param options.disableTaskTracking - Whether to disable task tracking for this session.
|
|
39
|
+
* @param options.configs - Optional session configuration dictionary.
|
|
40
|
+
* @param options.useUuid - Optional UUID string to use as the session ID. If not provided, a UUID will be auto-generated.
|
|
41
|
+
* If a session with this UUID already exists, a 409 Conflict error will be raised.
|
|
42
|
+
* @returns The created Session object.
|
|
43
|
+
*/
|
|
33
44
|
create(options?: {
|
|
34
45
|
user?: string | null;
|
|
35
46
|
disableTaskTracking?: boolean | null;
|
|
36
47
|
configs?: Record<string, unknown>;
|
|
48
|
+
useUuid?: string | null;
|
|
37
49
|
}): Promise<Session>;
|
|
38
50
|
delete(sessionId: string): Promise<void>;
|
|
39
51
|
updateConfigs(sessionId: string, options: {
|
|
@@ -44,6 +44,17 @@ class SessionsAPI {
|
|
|
44
44
|
});
|
|
45
45
|
return types_1.ListSessionsOutputSchema.parse(data);
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Create a new session.
|
|
49
|
+
*
|
|
50
|
+
* @param options - Options for creating a session.
|
|
51
|
+
* @param options.user - Optional user identifier string.
|
|
52
|
+
* @param options.disableTaskTracking - Whether to disable task tracking for this session.
|
|
53
|
+
* @param options.configs - Optional session configuration dictionary.
|
|
54
|
+
* @param options.useUuid - Optional UUID string to use as the session ID. If not provided, a UUID will be auto-generated.
|
|
55
|
+
* If a session with this UUID already exists, a 409 Conflict error will be raised.
|
|
56
|
+
* @returns The created Session object.
|
|
57
|
+
*/
|
|
47
58
|
async create(options) {
|
|
48
59
|
const payload = {};
|
|
49
60
|
if (options?.user !== undefined && options?.user !== null) {
|
|
@@ -55,6 +66,9 @@ class SessionsAPI {
|
|
|
55
66
|
if (options?.configs !== undefined) {
|
|
56
67
|
payload.configs = options.configs;
|
|
57
68
|
}
|
|
69
|
+
if (options?.useUuid !== undefined && options?.useUuid !== null) {
|
|
70
|
+
payload.use_uuid = options.useUuid;
|
|
71
|
+
}
|
|
58
72
|
const data = await this.requester.request('POST', '/session', {
|
|
59
73
|
jsonData: Object.keys(payload).length > 0 ? payload : undefined,
|
|
60
74
|
});
|
package/dist/types/common.d.ts
CHANGED
|
@@ -7,3 +7,8 @@ export declare const FileContentSchema: z.ZodObject<{
|
|
|
7
7
|
raw: z.ZodString;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export type FileContent = z.infer<typeof FileContentSchema>;
|
|
10
|
+
export declare const FlagResponseSchema: z.ZodObject<{
|
|
11
|
+
status: z.ZodNumber;
|
|
12
|
+
errmsg: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type FlagResponse = z.infer<typeof FlagResponseSchema>;
|
package/dist/types/common.js
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
* Common type definitions shared across modules.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FileContentSchema = void 0;
|
|
6
|
+
exports.FlagResponseSchema = exports.FileContentSchema = void 0;
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
exports.FileContentSchema = zod_1.z.object({
|
|
9
9
|
type: zod_1.z.string(),
|
|
10
10
|
raw: zod_1.z.string(),
|
|
11
11
|
});
|
|
12
|
+
exports.FlagResponseSchema = zod_1.z.object({
|
|
13
|
+
status: zod_1.z.number(),
|
|
14
|
+
errmsg: zod_1.z.string(),
|
|
15
|
+
});
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -20,7 +20,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
__exportStar(require("./common"), exports);
|
|
21
21
|
__exportStar(require("./session"), exports);
|
|
22
22
|
__exportStar(require("./disk"), exports);
|
|
23
|
-
__exportStar(require("./tool"), exports);
|
|
24
23
|
__exportStar(require("./skill"), exports);
|
|
25
24
|
__exportStar(require("./sandbox"), exports);
|
|
26
25
|
__exportStar(require("./user"), exports);
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool endpoints.
|
|
3
|
-
*/
|
|
4
|
-
import { RequesterProtocol } from '../client-types';
|
|
5
|
-
import { ToolRenameItem, ToolReferenceData, FlagResponse } from '../types/tool';
|
|
6
|
-
export declare class ToolsAPI {
|
|
7
|
-
private requester;
|
|
8
|
-
constructor(requester: RequesterProtocol);
|
|
9
|
-
renameToolName(options: {
|
|
10
|
-
rename: ToolRenameItem[];
|
|
11
|
-
}): Promise<FlagResponse>;
|
|
12
|
-
getToolName(): Promise<ToolReferenceData[]>;
|
|
13
|
-
}
|
package/dist/resources/tools.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Tool endpoints.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ToolsAPI = void 0;
|
|
7
|
-
const tool_1 = require("../types/tool");
|
|
8
|
-
class ToolsAPI {
|
|
9
|
-
constructor(requester) {
|
|
10
|
-
this.requester = requester;
|
|
11
|
-
}
|
|
12
|
-
async renameToolName(options) {
|
|
13
|
-
const payload = { rename: options.rename };
|
|
14
|
-
const data = await this.requester.request('PUT', '/tool/name', {
|
|
15
|
-
jsonData: payload,
|
|
16
|
-
});
|
|
17
|
-
return tool_1.FlagResponseSchema.parse(data);
|
|
18
|
-
}
|
|
19
|
-
async getToolName() {
|
|
20
|
-
const data = await this.requester.request('GET', '/tool/name');
|
|
21
|
-
return Array.isArray(data)
|
|
22
|
-
? data.map((item) => tool_1.ToolReferenceDataSchema.parse(item))
|
|
23
|
-
: [];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.ToolsAPI = ToolsAPI;
|
package/dist/types/tool.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for tool resources.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
export declare const ToolRenameItemSchema: z.ZodObject<{
|
|
6
|
-
oldName: z.ZodString;
|
|
7
|
-
newName: z.ZodString;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
export type ToolRenameItem = z.infer<typeof ToolRenameItemSchema>;
|
|
10
|
-
export declare const ToolReferenceDataSchema: z.ZodObject<{
|
|
11
|
-
name: z.ZodString;
|
|
12
|
-
sop_count: z.ZodNumber;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
export type ToolReferenceData = z.infer<typeof ToolReferenceDataSchema>;
|
|
15
|
-
export declare const FlagResponseSchema: z.ZodObject<{
|
|
16
|
-
status: z.ZodNumber;
|
|
17
|
-
errmsg: z.ZodString;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
export type FlagResponse = z.infer<typeof FlagResponseSchema>;
|
package/dist/types/tool.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Type definitions for tool resources.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FlagResponseSchema = exports.ToolReferenceDataSchema = exports.ToolRenameItemSchema = void 0;
|
|
7
|
-
const zod_1 = require("zod");
|
|
8
|
-
exports.ToolRenameItemSchema = zod_1.z.object({
|
|
9
|
-
oldName: zod_1.z.string(),
|
|
10
|
-
newName: zod_1.z.string(),
|
|
11
|
-
});
|
|
12
|
-
exports.ToolReferenceDataSchema = zod_1.z.object({
|
|
13
|
-
name: zod_1.z.string(),
|
|
14
|
-
sop_count: zod_1.z.number(),
|
|
15
|
-
});
|
|
16
|
-
exports.FlagResponseSchema = zod_1.z.object({
|
|
17
|
-
status: zod_1.z.number(),
|
|
18
|
-
errmsg: zod_1.z.string(),
|
|
19
|
-
});
|