@acontext/acontext 0.1.15 → 0.1.18
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 +2 -0
- package/dist/client.js +2 -0
- package/dist/events.d.ts +31 -0
- package/dist/events.js +39 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -1
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.js +1 -0
- package/dist/resources/project.d.ts +23 -0
- package/dist/resources/project.js +34 -0
- package/dist/resources/sessions.d.ts +26 -1
- package/dist/resources/sessions.js +36 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/project.d.ts +9 -0
- package/dist/types/project.js +5 -0
- package/dist/types/session.d.ts +33 -0
- package/dist/types/session.js +18 -1
- package/package.json +5 -2
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { DisksAPI } from './resources/disks';
|
|
5
5
|
import { LearningSpacesAPI } from './resources/learning-spaces';
|
|
6
|
+
import { ProjectAPI } from './resources/project';
|
|
6
7
|
import { SandboxesAPI } from './resources/sandboxes';
|
|
7
8
|
import { SessionsAPI } from './resources/sessions';
|
|
8
9
|
import { SkillsAPI } from './resources/skills';
|
|
@@ -26,6 +27,7 @@ export declare class AcontextClient implements RequesterProtocol {
|
|
|
26
27
|
users: UsersAPI;
|
|
27
28
|
sandboxes: SandboxesAPI;
|
|
28
29
|
learningSpaces: LearningSpacesAPI;
|
|
30
|
+
project: ProjectAPI;
|
|
29
31
|
constructor(options?: AcontextClientOptions);
|
|
30
32
|
get baseUrl(): string;
|
|
31
33
|
/**
|
package/dist/client.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.AcontextClient = void 0;
|
|
|
40
40
|
const errors_1 = require("./errors");
|
|
41
41
|
const disks_1 = require("./resources/disks");
|
|
42
42
|
const learning_spaces_1 = require("./resources/learning-spaces");
|
|
43
|
+
const project_1 = require("./resources/project");
|
|
43
44
|
const sandboxes_1 = require("./resources/sandboxes");
|
|
44
45
|
const sessions_1 = require("./resources/sessions");
|
|
45
46
|
const skills_1 = require("./resources/skills");
|
|
@@ -79,6 +80,7 @@ class AcontextClient {
|
|
|
79
80
|
this.users = new users_1.UsersAPI(this);
|
|
80
81
|
this.sandboxes = new sandboxes_1.SandboxesAPI(this);
|
|
81
82
|
this.learningSpaces = new learning_spaces_1.LearningSpacesAPI(this);
|
|
83
|
+
this.project = new project_1.ProjectAPI(this);
|
|
82
84
|
}
|
|
83
85
|
get baseUrl() {
|
|
84
86
|
return this._baseUrl;
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session event types for the Acontext SDK.
|
|
3
|
+
*/
|
|
4
|
+
export interface EventPayload {
|
|
5
|
+
type: string;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A disk-related event.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DiskEvent {
|
|
12
|
+
readonly diskId: string;
|
|
13
|
+
readonly path: string;
|
|
14
|
+
readonly note?: string;
|
|
15
|
+
constructor(options: {
|
|
16
|
+
diskId: string;
|
|
17
|
+
path: string;
|
|
18
|
+
note?: string;
|
|
19
|
+
});
|
|
20
|
+
toPayload(): EventPayload;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A free-text event.
|
|
24
|
+
*/
|
|
25
|
+
export declare class TextEvent {
|
|
26
|
+
readonly text: string;
|
|
27
|
+
constructor(options: {
|
|
28
|
+
text: string;
|
|
29
|
+
});
|
|
30
|
+
toPayload(): EventPayload;
|
|
31
|
+
}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Session event types for the Acontext SDK.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TextEvent = exports.DiskEvent = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* A disk-related event.
|
|
9
|
+
*/
|
|
10
|
+
class DiskEvent {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.diskId = options.diskId;
|
|
13
|
+
this.path = options.path;
|
|
14
|
+
this.note = options.note;
|
|
15
|
+
}
|
|
16
|
+
toPayload() {
|
|
17
|
+
const data = {
|
|
18
|
+
disk_id: this.diskId,
|
|
19
|
+
path: this.path,
|
|
20
|
+
};
|
|
21
|
+
if (this.note !== undefined) {
|
|
22
|
+
data.note = this.note;
|
|
23
|
+
}
|
|
24
|
+
return { type: 'disk_event', data };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.DiskEvent = DiskEvent;
|
|
28
|
+
/**
|
|
29
|
+
* A free-text event.
|
|
30
|
+
*/
|
|
31
|
+
class TextEvent {
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.text = options.text;
|
|
34
|
+
}
|
|
35
|
+
toPayload() {
|
|
36
|
+
return { type: 'text_event', data: { text: this.text } };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.TextEvent = TextEvent;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type { AcontextClientOptions } from './client';
|
|
|
6
6
|
export { FileUpload } from './uploads';
|
|
7
7
|
export { MessagePart, AcontextMessage, buildAcontextMessage } from './messages';
|
|
8
8
|
export { APIError, TransportError, AcontextError, TimeoutError } from './errors';
|
|
9
|
+
export { DiskEvent, TextEvent } from './events';
|
|
10
|
+
export type { EventPayload } from './events';
|
|
9
11
|
export * from './types';
|
|
10
12
|
export * from './resources';
|
|
11
13
|
export * from './agent';
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.TimeoutError = exports.AcontextError = exports.TransportError = exports.APIError = exports.buildAcontextMessage = exports.AcontextMessage = exports.MessagePart = exports.FileUpload = exports.AcontextClient = void 0;
|
|
20
|
+
exports.TextEvent = exports.DiskEvent = exports.TimeoutError = exports.AcontextError = exports.TransportError = exports.APIError = exports.buildAcontextMessage = exports.AcontextMessage = exports.MessagePart = exports.FileUpload = exports.AcontextClient = void 0;
|
|
21
21
|
var client_1 = require("./client");
|
|
22
22
|
Object.defineProperty(exports, "AcontextClient", { enumerable: true, get: function () { return client_1.AcontextClient; } });
|
|
23
23
|
var uploads_1 = require("./uploads");
|
|
@@ -31,6 +31,9 @@ Object.defineProperty(exports, "APIError", { enumerable: true, get: function ()
|
|
|
31
31
|
Object.defineProperty(exports, "TransportError", { enumerable: true, get: function () { return errors_1.TransportError; } });
|
|
32
32
|
Object.defineProperty(exports, "AcontextError", { enumerable: true, get: function () { return errors_1.AcontextError; } });
|
|
33
33
|
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_1.TimeoutError; } });
|
|
34
|
+
var events_1 = require("./events");
|
|
35
|
+
Object.defineProperty(exports, "DiskEvent", { enumerable: true, get: function () { return events_1.DiskEvent; } });
|
|
36
|
+
Object.defineProperty(exports, "TextEvent", { enumerable: true, get: function () { return events_1.TextEvent; } });
|
|
34
37
|
__exportStar(require("./types"), exports);
|
|
35
38
|
__exportStar(require("./resources"), exports);
|
|
36
39
|
__exportStar(require("./agent"), exports);
|
package/dist/resources/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project configuration endpoints.
|
|
3
|
+
*/
|
|
4
|
+
import { RequesterProtocol } from '../client-types';
|
|
5
|
+
import { ProjectConfig, ProjectConfigUpdate } from '../types/project';
|
|
6
|
+
export declare class ProjectAPI {
|
|
7
|
+
private requester;
|
|
8
|
+
constructor(requester: RequesterProtocol);
|
|
9
|
+
/**
|
|
10
|
+
* Get the project-level configuration.
|
|
11
|
+
*
|
|
12
|
+
* @returns ProjectConfig containing the current project configuration
|
|
13
|
+
*/
|
|
14
|
+
getConfigs(): Promise<ProjectConfig>;
|
|
15
|
+
/**
|
|
16
|
+
* Update the project-level configuration by merging keys.
|
|
17
|
+
* Keys with null values are deleted (reset to default).
|
|
18
|
+
*
|
|
19
|
+
* @param configs - Configuration keys to merge
|
|
20
|
+
* @returns ProjectConfig containing the updated project configuration
|
|
21
|
+
*/
|
|
22
|
+
updateConfigs(configs: ProjectConfigUpdate): Promise<ProjectConfig>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Project configuration endpoints.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProjectAPI = void 0;
|
|
7
|
+
class ProjectAPI {
|
|
8
|
+
constructor(requester) {
|
|
9
|
+
this.requester = requester;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get the project-level configuration.
|
|
13
|
+
*
|
|
14
|
+
* @returns ProjectConfig containing the current project configuration
|
|
15
|
+
*/
|
|
16
|
+
async getConfigs() {
|
|
17
|
+
const data = await this.requester.request('GET', '/project/configs');
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Update the project-level configuration by merging keys.
|
|
22
|
+
* Keys with null values are deleted (reset to default).
|
|
23
|
+
*
|
|
24
|
+
* @param configs - Configuration keys to merge
|
|
25
|
+
* @returns ProjectConfig containing the updated project configuration
|
|
26
|
+
*/
|
|
27
|
+
async updateConfigs(configs) {
|
|
28
|
+
const data = await this.requester.request('PATCH', '/project/configs', {
|
|
29
|
+
jsonData: configs,
|
|
30
|
+
});
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.ProjectAPI = ProjectAPI;
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import { RequesterProtocol } from '../client-types';
|
|
5
5
|
import { AcontextMessage } from '../messages';
|
|
6
6
|
import { FileUpload } from '../uploads';
|
|
7
|
-
import { EditStrategy, CopySessionResult, GetMessagesOutput, GetTasksOutput, ListSessionsOutput, Message, MessageObservingStatus, Session, TokenCounts } from '../types';
|
|
7
|
+
import { EditStrategy, CopySessionResult, GetMessagesOutput, GetTasksOutput, ListEventsOutput, ListSessionsOutput, Message, MessageObservingStatus, Session, SessionEvent, TokenCounts } from '../types';
|
|
8
|
+
import type { EventPayload } from '../events';
|
|
8
9
|
export type MessageBlob = AcontextMessage | Record<string, unknown>;
|
|
9
10
|
export declare class SessionsAPI {
|
|
10
11
|
private requester;
|
|
@@ -88,6 +89,28 @@ export declare class SessionsAPI {
|
|
|
88
89
|
fileField?: string | null;
|
|
89
90
|
file?: FileUpload | null;
|
|
90
91
|
}): Promise<Message>;
|
|
92
|
+
/**
|
|
93
|
+
* Add a structured event to a session.
|
|
94
|
+
*
|
|
95
|
+
* @param sessionId - The UUID of the session.
|
|
96
|
+
* @param event - An event object with a toPayload() method (e.g., DiskEvent, TextEvent).
|
|
97
|
+
* @returns The created SessionEvent object.
|
|
98
|
+
*/
|
|
99
|
+
addEvent(sessionId: string, event: {
|
|
100
|
+
toPayload(): EventPayload;
|
|
101
|
+
}): Promise<SessionEvent>;
|
|
102
|
+
/**
|
|
103
|
+
* Get events for a session.
|
|
104
|
+
*
|
|
105
|
+
* @param sessionId - The UUID of the session.
|
|
106
|
+
* @param options - Options for retrieving events.
|
|
107
|
+
* @returns ListEventsOutput containing the list of events and pagination information.
|
|
108
|
+
*/
|
|
109
|
+
getEvents(sessionId: string, options?: {
|
|
110
|
+
limit?: number | null;
|
|
111
|
+
cursor?: string | null;
|
|
112
|
+
timeDesc?: boolean | null;
|
|
113
|
+
}): Promise<ListEventsOutput>;
|
|
91
114
|
/**
|
|
92
115
|
* Get messages for a session.
|
|
93
116
|
*
|
|
@@ -96,6 +119,7 @@ export declare class SessionsAPI {
|
|
|
96
119
|
* @param options.limit - Maximum number of messages to return.
|
|
97
120
|
* @param options.cursor - Cursor for pagination.
|
|
98
121
|
* @param options.withAssetPublicUrl - Whether to include presigned URLs for assets.
|
|
122
|
+
* @param options.withEvents - Whether to include session events in the response.
|
|
99
123
|
* @param options.format - The format of the messages ('acontext', 'openai', 'anthropic', or 'gemini').
|
|
100
124
|
* @param options.timeDesc - Order by created_at descending if true, ascending if false.
|
|
101
125
|
* @param options.editStrategies - Optional list of edit strategies to apply before format conversion.
|
|
@@ -117,6 +141,7 @@ export declare class SessionsAPI {
|
|
|
117
141
|
limit?: number | null;
|
|
118
142
|
cursor?: string | null;
|
|
119
143
|
withAssetPublicUrl?: boolean | null;
|
|
144
|
+
withEvents?: boolean | null;
|
|
120
145
|
format?: 'acontext' | 'openai' | 'anthropic' | 'gemini';
|
|
121
146
|
timeDesc?: boolean | null;
|
|
122
147
|
editStrategies?: Array<EditStrategy> | null;
|
|
@@ -201,6 +201,38 @@ class SessionsAPI {
|
|
|
201
201
|
return types_1.MessageSchema.parse(data);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Add a structured event to a session.
|
|
206
|
+
*
|
|
207
|
+
* @param sessionId - The UUID of the session.
|
|
208
|
+
* @param event - An event object with a toPayload() method (e.g., DiskEvent, TextEvent).
|
|
209
|
+
* @returns The created SessionEvent object.
|
|
210
|
+
*/
|
|
211
|
+
async addEvent(sessionId, event) {
|
|
212
|
+
const payload = event.toPayload();
|
|
213
|
+
const data = await this.requester.request('POST', `/session/${sessionId}/events`, {
|
|
214
|
+
jsonData: payload,
|
|
215
|
+
});
|
|
216
|
+
return types_1.SessionEventSchema.parse(data);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Get events for a session.
|
|
220
|
+
*
|
|
221
|
+
* @param sessionId - The UUID of the session.
|
|
222
|
+
* @param options - Options for retrieving events.
|
|
223
|
+
* @returns ListEventsOutput containing the list of events and pagination information.
|
|
224
|
+
*/
|
|
225
|
+
async getEvents(sessionId, options) {
|
|
226
|
+
const params = (0, utils_1.buildParams)({
|
|
227
|
+
limit: options?.limit ?? null,
|
|
228
|
+
cursor: options?.cursor ?? null,
|
|
229
|
+
time_desc: options?.timeDesc ?? null,
|
|
230
|
+
});
|
|
231
|
+
const data = await this.requester.request('GET', `/session/${sessionId}/events`, {
|
|
232
|
+
params: Object.keys(params).length > 0 ? params : undefined,
|
|
233
|
+
});
|
|
234
|
+
return types_1.ListEventsOutputSchema.parse(data);
|
|
235
|
+
}
|
|
204
236
|
/**
|
|
205
237
|
* Get messages for a session.
|
|
206
238
|
*
|
|
@@ -209,6 +241,7 @@ class SessionsAPI {
|
|
|
209
241
|
* @param options.limit - Maximum number of messages to return.
|
|
210
242
|
* @param options.cursor - Cursor for pagination.
|
|
211
243
|
* @param options.withAssetPublicUrl - Whether to include presigned URLs for assets.
|
|
244
|
+
* @param options.withEvents - Whether to include session events in the response.
|
|
212
245
|
* @param options.format - The format of the messages ('acontext', 'openai', 'anthropic', or 'gemini').
|
|
213
246
|
* @param options.timeDesc - Order by created_at descending if true, ascending if false.
|
|
214
247
|
* @param options.editStrategies - Optional list of edit strategies to apply before format conversion.
|
|
@@ -237,6 +270,9 @@ class SessionsAPI {
|
|
|
237
270
|
with_asset_public_url: options?.withAssetPublicUrl ?? null,
|
|
238
271
|
time_desc: options?.timeDesc ?? true, // Default to true
|
|
239
272
|
}));
|
|
273
|
+
if (options?.withEvents !== undefined && options?.withEvents !== null) {
|
|
274
|
+
params.with_events = options.withEvents ? 'true' : 'false';
|
|
275
|
+
}
|
|
240
276
|
if (options?.editStrategies !== undefined && options?.editStrategies !== null) {
|
|
241
277
|
types_1.EditStrategySchema.array().parse(options.editStrategies);
|
|
242
278
|
params.edit_strategies = JSON.stringify(options.editStrategies);
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
package/dist/types/session.d.ts
CHANGED
|
@@ -112,6 +112,30 @@ export declare const PublicURLSchema: z.ZodObject<{
|
|
|
112
112
|
expire_at: z.ZodString;
|
|
113
113
|
}, z.core.$strip>;
|
|
114
114
|
export type PublicURL = z.infer<typeof PublicURLSchema>;
|
|
115
|
+
export declare const SessionEventSchema: z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
session_id: z.ZodString;
|
|
118
|
+
project_id: z.ZodString;
|
|
119
|
+
type: z.ZodString;
|
|
120
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
121
|
+
created_at: z.ZodString;
|
|
122
|
+
updated_at: z.ZodString;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
export type SessionEvent = z.infer<typeof SessionEventSchema>;
|
|
125
|
+
export declare const ListEventsOutputSchema: z.ZodObject<{
|
|
126
|
+
items: z.ZodArray<z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
session_id: z.ZodString;
|
|
129
|
+
project_id: z.ZodString;
|
|
130
|
+
type: z.ZodString;
|
|
131
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
132
|
+
created_at: z.ZodString;
|
|
133
|
+
updated_at: z.ZodString;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
+
has_more: z.ZodBoolean;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
export type ListEventsOutput = z.infer<typeof ListEventsOutputSchema>;
|
|
115
139
|
export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
116
140
|
items: z.ZodArray<z.ZodUnknown>;
|
|
117
141
|
ids: z.ZodArray<z.ZodString>;
|
|
@@ -124,6 +148,15 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
|
124
148
|
expire_at: z.ZodString;
|
|
125
149
|
}, z.core.$strip>>>>;
|
|
126
150
|
edit_at_message_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
151
|
+
events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
session_id: z.ZodString;
|
|
154
|
+
project_id: z.ZodString;
|
|
155
|
+
type: z.ZodString;
|
|
156
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
157
|
+
created_at: z.ZodString;
|
|
158
|
+
updated_at: z.ZodString;
|
|
159
|
+
}, z.core.$strip>>>>;
|
|
127
160
|
}, z.core.$strip>;
|
|
128
161
|
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|
|
129
162
|
export declare const GetTasksOutputSchema: z.ZodObject<{
|
package/dist/types/session.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Type definitions for session, message, and task resources.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EditStrategySchema = exports.MiddleOutStrategySchema = exports.MiddleOutParamsSchema = exports.TokenLimitStrategySchema = exports.TokenLimitParamsSchema = exports.RemoveToolResultStrategySchema = exports.RemoveToolCallParamsStrategySchema = exports.RemoveToolCallParamsParamsSchema = exports.RemoveToolResultParamsSchema = exports.CopySessionResultSchema = exports.MessageObservingStatusSchema = exports.TokenCountsSchema = exports.GetTasksOutputSchema = exports.GetMessagesOutputSchema = exports.PublicURLSchema = exports.ListSessionsOutputSchema = exports.TaskSchema = exports.TaskDataSchema = exports.SessionSchema = exports.MessageSchema = exports.PartSchema = exports.AssetSchema = void 0;
|
|
6
|
+
exports.EditStrategySchema = exports.MiddleOutStrategySchema = exports.MiddleOutParamsSchema = exports.TokenLimitStrategySchema = exports.TokenLimitParamsSchema = exports.RemoveToolResultStrategySchema = exports.RemoveToolCallParamsStrategySchema = exports.RemoveToolCallParamsParamsSchema = exports.RemoveToolResultParamsSchema = exports.CopySessionResultSchema = exports.MessageObservingStatusSchema = exports.TokenCountsSchema = exports.GetTasksOutputSchema = exports.GetMessagesOutputSchema = exports.ListEventsOutputSchema = exports.SessionEventSchema = exports.PublicURLSchema = exports.ListSessionsOutputSchema = exports.TaskSchema = exports.TaskDataSchema = exports.SessionSchema = exports.MessageSchema = exports.PartSchema = exports.AssetSchema = void 0;
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
exports.AssetSchema = zod_1.z.object({
|
|
9
9
|
bucket: zod_1.z.string(),
|
|
@@ -32,6 +32,7 @@ exports.MessageSchema = zod_1.z.object({
|
|
|
32
32
|
meta: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
33
33
|
parts: zod_1.z.array(exports.PartSchema),
|
|
34
34
|
task_id: zod_1.z.string().nullable(),
|
|
35
|
+
/** Task process status: 'success' | 'failed' | 'running' | 'pending' | 'disable_tracking' | 'limit_exceed' */
|
|
35
36
|
session_task_process_status: zod_1.z.string(),
|
|
36
37
|
created_at: zod_1.z.string(),
|
|
37
38
|
updated_at: zod_1.z.string(),
|
|
@@ -75,6 +76,20 @@ exports.PublicURLSchema = zod_1.z.object({
|
|
|
75
76
|
url: zod_1.z.string(),
|
|
76
77
|
expire_at: zod_1.z.string(),
|
|
77
78
|
});
|
|
79
|
+
exports.SessionEventSchema = zod_1.z.object({
|
|
80
|
+
id: zod_1.z.string(),
|
|
81
|
+
session_id: zod_1.z.string(),
|
|
82
|
+
project_id: zod_1.z.string(),
|
|
83
|
+
type: zod_1.z.string(),
|
|
84
|
+
data: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
85
|
+
created_at: zod_1.z.string(),
|
|
86
|
+
updated_at: zod_1.z.string(),
|
|
87
|
+
});
|
|
88
|
+
exports.ListEventsOutputSchema = zod_1.z.object({
|
|
89
|
+
items: zod_1.z.array(exports.SessionEventSchema),
|
|
90
|
+
next_cursor: zod_1.z.string().nullable().optional(),
|
|
91
|
+
has_more: zod_1.z.boolean(),
|
|
92
|
+
});
|
|
78
93
|
exports.GetMessagesOutputSchema = zod_1.z.object({
|
|
79
94
|
items: zod_1.z.array(zod_1.z.unknown()),
|
|
80
95
|
ids: zod_1.z.array(zod_1.z.string()),
|
|
@@ -93,6 +108,8 @@ exports.GetMessagesOutputSchema = zod_1.z.object({
|
|
|
93
108
|
* pin_editing_strategies_at_message in subsequent requests.
|
|
94
109
|
*/
|
|
95
110
|
edit_at_message_id: zod_1.z.string().nullable().optional(),
|
|
111
|
+
/** Session events within the messages time window (only when withEvents is true) */
|
|
112
|
+
events: zod_1.z.array(exports.SessionEventSchema).nullable().optional(),
|
|
96
113
|
});
|
|
97
114
|
exports.GetTasksOutputSchema = zod_1.z.object({
|
|
98
115
|
items: zod_1.z.array(exports.TaskSchema),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acontext/acontext",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "TypeScript SDK for the Acontext API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,5 +54,8 @@
|
|
|
54
54
|
"files": [
|
|
55
55
|
"dist",
|
|
56
56
|
"README.md"
|
|
57
|
-
]
|
|
57
|
+
],
|
|
58
|
+
"overrides": {
|
|
59
|
+
"minimatch": ">=10.0.1"
|
|
60
|
+
}
|
|
58
61
|
}
|