@acontext/acontext 0.0.3 → 0.0.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.js CHANGED
@@ -70,7 +70,7 @@ class AcontextClient {
70
70
  options.timeout ??
71
71
  (typeof process !== 'undefined' && process.env?.ACONTEXT_TIMEOUT
72
72
  ? parseFloat(process.env.ACONTEXT_TIMEOUT)
73
- : 10000);
73
+ : 320000);
74
74
  this.spaces = new spaces_1.SpacesAPI(this);
75
75
  this.sessions = new sessions_1.SessionsAPI(this);
76
76
  this.disks = new disks_1.DisksAPI(this);
@@ -4,7 +4,7 @@
4
4
  import { RequesterProtocol } from '../client-types';
5
5
  import { AcontextMessage } from '../messages';
6
6
  import { FileUpload } from '../uploads';
7
- import { GetMessagesOutput, GetTasksOutput, ListSessionsOutput, Message, Session } from '../types';
7
+ import { GetMessagesOutput, GetTasksOutput, LearningStatus, ListSessionsOutput, Message, Session } from '../types';
8
8
  export type MessageBlob = AcontextMessage | Record<string, unknown>;
9
9
  export declare class SessionsAPI {
10
10
  private requester;
@@ -49,4 +49,14 @@ export declare class SessionsAPI {
49
49
  status: number;
50
50
  errmsg: string;
51
51
  }>;
52
+ /**
53
+ * Get learning status for a session.
54
+ *
55
+ * Returns the count of space digested tasks and not space digested tasks.
56
+ * If the session is not connected to a space, returns 0 and 0.
57
+ *
58
+ * @param sessionId - The UUID of the session.
59
+ * @returns LearningStatus object containing space_digested_count and not_space_digested_count.
60
+ */
61
+ getLearningStatus(sessionId: string): Promise<LearningStatus>;
52
62
  }
@@ -135,5 +135,18 @@ class SessionsAPI {
135
135
  const data = await this.requester.request('POST', `/session/${sessionId}/flush`);
136
136
  return data;
137
137
  }
138
+ /**
139
+ * Get learning status for a session.
140
+ *
141
+ * Returns the count of space digested tasks and not space digested tasks.
142
+ * If the session is not connected to a space, returns 0 and 0.
143
+ *
144
+ * @param sessionId - The UUID of the session.
145
+ * @returns LearningStatus object containing space_digested_count and not_space_digested_count.
146
+ */
147
+ async getLearningStatus(sessionId) {
148
+ const data = await this.requester.request('GET', `/session/${sessionId}/get_learning_status`);
149
+ return types_1.LearningStatusSchema.parse(data);
150
+ }
138
151
  }
139
152
  exports.SessionsAPI = SessionsAPI;
@@ -119,3 +119,8 @@ export declare const GetTasksOutputSchema: z.ZodObject<{
119
119
  has_more: z.ZodBoolean;
120
120
  }, z.core.$strip>;
121
121
  export type GetTasksOutput = z.infer<typeof GetTasksOutputSchema>;
122
+ export declare const LearningStatusSchema: z.ZodObject<{
123
+ space_digested_count: z.ZodNumber;
124
+ not_space_digested_count: z.ZodNumber;
125
+ }, z.core.$strip>;
126
+ export type LearningStatus = z.infer<typeof LearningStatusSchema>;
@@ -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.GetTasksOutputSchema = exports.GetMessagesOutputSchema = exports.PublicURLSchema = exports.ListSessionsOutputSchema = exports.TaskSchema = exports.SessionSchema = exports.MessageSchema = exports.PartSchema = exports.AssetSchema = void 0;
6
+ exports.LearningStatusSchema = exports.GetTasksOutputSchema = exports.GetMessagesOutputSchema = exports.PublicURLSchema = exports.ListSessionsOutputSchema = exports.TaskSchema = 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(),
@@ -72,3 +72,7 @@ exports.GetTasksOutputSchema = zod_1.z.object({
72
72
  next_cursor: zod_1.z.string().nullable().optional(),
73
73
  has_more: zod_1.z.boolean(),
74
74
  });
75
+ exports.LearningStatusSchema = zod_1.z.object({
76
+ space_digested_count: zod_1.z.number(),
77
+ not_space_digested_count: zod_1.z.number(),
78
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acontext/acontext",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "TypeScript SDK for the Acontext API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,6 +20,10 @@
20
20
  ],
21
21
  "author": "",
22
22
  "license": "MIT",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/memodb-io/Acontext"
26
+ },
23
27
  "dependencies": {
24
28
  "zod": "^4.1.12"
25
29
  },
@@ -49,5 +53,4 @@
49
53
  "dist",
50
54
  "README.md"
51
55
  ]
52
- }
53
-
56
+ }