@acontext/acontext 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # acontext client for TypeScript
1
+ # Acontext client for TypeScript
2
2
 
3
3
  TypeScript SDK for interacting with the Acontext REST API.
4
4
 
@@ -13,7 +13,7 @@ npm install @acontext/acontext
13
13
  ```typescript
14
14
  import { AcontextClient, MessagePart } from '@acontext/acontext';
15
15
 
16
- const client = new AcontextClient({ apiKey: 'sk_project_token' });
16
+ const client = new AcontextClient({ apiKey: 'sk-ac-your-root-api-bearer-token' });
17
17
 
18
18
  // List spaces for the authenticated project
19
19
  const spaces = await client.spaces.list();
@@ -30,6 +30,9 @@ await client.sessions.sendMessage(
30
30
  },
31
31
  { format: 'acontext' }
32
32
  );
33
+
34
+ // Flush session buffer when needed
35
+ await client.sessions.flush(session.id);
33
36
  ```
34
37
 
35
38
  See the inline documentation for the full list of helpers covering sessions, spaces, disks, and artifact uploads.
@@ -41,7 +44,7 @@ Artifacts now live under project disks. Create a disk first, then upload files t
41
44
  ```typescript
42
45
  import { AcontextClient, FileUpload } from '@acontext/acontext';
43
46
 
44
- const client = new AcontextClient({ apiKey: 'sk_project_token' });
47
+ const client = new AcontextClient({ apiKey: 'sk-ac-your-root-api-bearer-token' });
45
48
 
46
49
  const disk = await client.disks.create();
47
50
  await client.disks.artifacts.upsert(
@@ -63,7 +66,7 @@ await client.disks.artifacts.upsert(
63
66
  ```typescript
64
67
  import { AcontextClient } from '@acontext/acontext';
65
68
 
66
- const client = new AcontextClient({ apiKey: 'sk_project_token' });
69
+ const client = new AcontextClient({ apiKey: 'sk-ac-your-root-api-bearer-token' });
67
70
 
68
71
  const space = await client.spaces.create();
69
72
  const page = await client.blocks.create(space.id, {
@@ -78,3 +81,116 @@ await client.blocks.create(space.id, {
78
81
  });
79
82
  ```
80
83
 
84
+ ## Managing sessions
85
+
86
+ ### Flush session buffer
87
+
88
+ The `flush` method clears the session buffer, useful for managing session state:
89
+
90
+ ```typescript
91
+ const result = await client.sessions.flush('session-uuid');
92
+ console.log(result); // { status: 0, errmsg: '' }
93
+ ```
94
+
95
+ ## Working with tools
96
+
97
+ The SDK provides APIs to manage tool names within your project:
98
+
99
+ ### Get tool names
100
+
101
+ ```typescript
102
+ const tools = await client.tools.getToolName();
103
+ for (const tool of tools) {
104
+ console.log(`${tool.name} (used in ${tool.sop_count} SOPs)`);
105
+ }
106
+ ```
107
+
108
+ ### Rename tool names
109
+
110
+ ```typescript
111
+ const result = await client.tools.renameToolName({
112
+ rename: [
113
+ { oldName: 'calculate', newName: 'calculate_math' },
114
+ { oldName: 'search', newName: 'search_web' },
115
+ ],
116
+ });
117
+ console.log(result); // { status: 0, errmsg: '' }
118
+ ```
119
+
120
+ ## Semantic search within spaces
121
+
122
+ The SDK provides three powerful semantic search APIs for finding content within your spaces:
123
+
124
+ ### 1. Experience Search (Advanced AI-powered search)
125
+
126
+ The most sophisticated search that can operate in two modes: **fast** (quick semantic search) or **agentic** (AI-powered iterative refinement).
127
+
128
+ ```typescript
129
+ import { AcontextClient } from '@acontext/acontext';
130
+
131
+ const client = new AcontextClient({ apiKey: 'sk_project_token' });
132
+
133
+ // Fast mode - quick semantic search
134
+ const result = await client.spaces.experienceSearch('space-uuid', {
135
+ query: 'How to implement authentication?',
136
+ limit: 10,
137
+ mode: 'fast',
138
+ semanticThreshold: 0.8,
139
+ });
140
+
141
+ // Agentic mode - AI-powered iterative search
142
+ const agenticResult = await client.spaces.experienceSearch('space-uuid', {
143
+ query: 'What are the best practices for API security?',
144
+ limit: 10,
145
+ mode: 'agentic',
146
+ maxIterations: 20,
147
+ });
148
+
149
+ // Access results
150
+ for (const block of result.cited_blocks) {
151
+ console.log(`${block.title} (distance: ${block.distance})`);
152
+ }
153
+
154
+ if (result.final_answer) {
155
+ console.log(`AI Answer: ${result.final_answer}`);
156
+ }
157
+ ```
158
+
159
+ ### 2. Semantic Global (Search page/folder titles)
160
+
161
+ Search for pages and folders by their titles using semantic similarity (like a semantic version of `glob`):
162
+
163
+ ```typescript
164
+ // Find pages about authentication
165
+ const results = await client.spaces.semanticGlobal('space-uuid', {
166
+ query: 'authentication and authorization pages',
167
+ limit: 10,
168
+ threshold: 1.0, // Only show results with distance < 1.0
169
+ });
170
+
171
+ for (const block of results) {
172
+ console.log(`${block.title} - ${block.type}`);
173
+ }
174
+ ```
175
+
176
+ ### 3. Semantic Grep (Search content blocks)
177
+
178
+ Search through actual content blocks using semantic similarity (like a semantic version of `grep`):
179
+
180
+ ```typescript
181
+ // Find code examples for JWT validation
182
+ const results = await client.spaces.semanticGrep('space-uuid', {
183
+ query: 'JWT token validation code examples',
184
+ limit: 15,
185
+ threshold: 0.7,
186
+ });
187
+
188
+ for (const block of results) {
189
+ console.log(`${block.title} - distance: ${block.distance}`);
190
+ const content = block.props.text || block.props.content;
191
+ if (content) {
192
+ console.log(`Content: ${String(content).substring(0, 100)}...`);
193
+ }
194
+ }
195
+ ```
196
+
package/dist/client.d.ts CHANGED
@@ -5,6 +5,7 @@ import { BlocksAPI } from './resources/blocks';
5
5
  import { DisksAPI } from './resources/disks';
6
6
  import { SessionsAPI } from './resources/sessions';
7
7
  import { SpacesAPI } from './resources/spaces';
8
+ import { ToolsAPI } from './resources/tools';
8
9
  import { RequesterProtocol } from './client-types';
9
10
  export interface AcontextClientOptions {
10
11
  apiKey?: string | null;
@@ -22,6 +23,7 @@ export declare class AcontextClient implements RequesterProtocol {
22
23
  disks: DisksAPI;
23
24
  artifacts: DisksAPI['artifacts'];
24
25
  blocks: BlocksAPI;
26
+ tools: ToolsAPI;
25
27
  constructor(options?: AcontextClientOptions);
26
28
  get baseUrl(): string;
27
29
  request<T = unknown>(method: string, path: string, options?: {
package/dist/client.js CHANGED
@@ -42,6 +42,7 @@ const blocks_1 = require("./resources/blocks");
42
42
  const disks_1 = require("./resources/disks");
43
43
  const sessions_1 = require("./resources/sessions");
44
44
  const spaces_1 = require("./resources/spaces");
45
+ const tools_1 = require("./resources/tools");
45
46
  const constants_1 = require("./constants");
46
47
  class AcontextClient {
47
48
  constructor(options = {}) {
@@ -75,6 +76,7 @@ class AcontextClient {
75
76
  this.disks = new disks_1.DisksAPI(this);
76
77
  this.artifacts = this.disks.artifacts;
77
78
  this.blocks = new blocks_1.BlocksAPI(this);
79
+ this.tools = new tools_1.ToolsAPI(this);
78
80
  }
79
81
  get baseUrl() {
80
82
  return this._baseUrl;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { RequesterProtocol } from '../client-types';
5
5
  import { Block } from '../types';
6
+ import { InsertBlockResponse } from '../types/tool';
6
7
  export declare class BlocksAPI {
7
8
  private requester;
8
9
  constructor(requester: RequesterProtocol);
@@ -15,7 +16,7 @@ export declare class BlocksAPI {
15
16
  parentId?: string | null;
16
17
  title?: string | null;
17
18
  props?: Record<string, unknown> | null;
18
- }): Promise<Block>;
19
+ }): Promise<InsertBlockResponse>;
19
20
  delete(spaceId: string, blockId: string): Promise<void>;
20
21
  getProperties(spaceId: string, blockId: string): Promise<Block>;
21
22
  updateProperties(spaceId: string, blockId: string, options: {
@@ -5,6 +5,7 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BlocksAPI = void 0;
7
7
  const types_1 = require("../types");
8
+ const tool_1 = require("../types/tool");
8
9
  class BlocksAPI {
9
10
  constructor(requester) {
10
11
  this.requester = requester;
@@ -36,7 +37,7 @@ class BlocksAPI {
36
37
  const data = await this.requester.request('POST', `/space/${spaceId}/block`, {
37
38
  jsonData: payload,
38
39
  });
39
- return types_1.BlockSchema.parse(data);
40
+ return tool_1.InsertBlockResponseSchema.parse(data);
40
41
  }
41
42
  async delete(spaceId, blockId) {
42
43
  await this.requester.request('DELETE', `/space/${spaceId}/block/${blockId}`);
@@ -5,3 +5,4 @@ export * from './spaces';
5
5
  export * from './sessions';
6
6
  export * from './disks';
7
7
  export * from './blocks';
8
+ export * from './tools';
@@ -21,3 +21,4 @@ __exportStar(require("./spaces"), exports);
21
21
  __exportStar(require("./sessions"), exports);
22
22
  __exportStar(require("./disks"), exports);
23
23
  __exportStar(require("./blocks"), exports);
24
+ __exportStar(require("./tools"), exports);
@@ -45,4 +45,8 @@ export declare class SessionsAPI {
45
45
  format?: 'acontext' | 'openai' | 'anthropic';
46
46
  timeDesc?: boolean | null;
47
47
  }): Promise<GetMessagesOutput>;
48
+ flush(sessionId: string): Promise<{
49
+ status: number;
50
+ errmsg: string;
51
+ }>;
48
52
  }
@@ -131,5 +131,9 @@ class SessionsAPI {
131
131
  });
132
132
  return types_1.GetMessagesOutputSchema.parse(data);
133
133
  }
134
+ async flush(sessionId) {
135
+ const data = await this.requester.request('POST', `/session/${sessionId}/flush`);
136
+ return data;
137
+ }
134
138
  }
135
139
  exports.SessionsAPI = SessionsAPI;
@@ -2,7 +2,7 @@
2
2
  * Spaces endpoints.
3
3
  */
4
4
  import { RequesterProtocol } from '../client-types';
5
- import { ListSpacesOutput, Space } from '../types';
5
+ import { ListSpacesOutput, SearchResultBlockItem, Space, SpaceSearchResult } from '../types';
6
6
  export declare class SpacesAPI {
7
7
  private requester;
8
8
  constructor(requester: RequesterProtocol);
@@ -19,4 +19,52 @@ export declare class SpacesAPI {
19
19
  configs: Record<string, unknown>;
20
20
  }): Promise<void>;
21
21
  getConfigs(spaceId: string): Promise<Space>;
22
+ /**
23
+ * Perform experience search within a space.
24
+ *
25
+ * This is the most advanced search option that can operate in two modes:
26
+ * - fast: Quick semantic search (default)
27
+ * - agentic: Iterative search with AI-powered refinement
28
+ *
29
+ * @param spaceId - The UUID of the space
30
+ * @param options - Search options
31
+ * @returns SpaceSearchResult containing cited blocks and optional final answer
32
+ */
33
+ experienceSearch(spaceId: string, options: {
34
+ query: string;
35
+ limit?: number | null;
36
+ mode?: 'fast' | 'agentic' | null;
37
+ semanticThreshold?: number | null;
38
+ maxIterations?: number | null;
39
+ }): Promise<SpaceSearchResult>;
40
+ /**
41
+ * Perform semantic global (glob) search for page/folder titles.
42
+ *
43
+ * Searches specifically for page/folder titles using semantic similarity,
44
+ * similar to a semantic version of the glob command.
45
+ *
46
+ * @param spaceId - The UUID of the space
47
+ * @param options - Search options
48
+ * @returns List of SearchResultBlockItem objects matching the query
49
+ */
50
+ semanticGlobal(spaceId: string, options: {
51
+ query: string;
52
+ limit?: number | null;
53
+ threshold?: number | null;
54
+ }): Promise<SearchResultBlockItem[]>;
55
+ /**
56
+ * Perform semantic grep search for content blocks.
57
+ *
58
+ * Searches through content blocks (actual text content) using semantic similarity,
59
+ * similar to a semantic version of the grep command.
60
+ *
61
+ * @param spaceId - The UUID of the space
62
+ * @param options - Search options
63
+ * @returns List of SearchResultBlockItem objects matching the query
64
+ */
65
+ semanticGrep(spaceId: string, options: {
66
+ query: string;
67
+ limit?: number | null;
68
+ threshold?: number | null;
69
+ }): Promise<SearchResultBlockItem[]>;
22
70
  }
@@ -44,5 +44,65 @@ class SpacesAPI {
44
44
  const data = await this.requester.request('GET', `/space/${spaceId}/configs`);
45
45
  return types_1.SpaceSchema.parse(data);
46
46
  }
47
+ /**
48
+ * Perform experience search within a space.
49
+ *
50
+ * This is the most advanced search option that can operate in two modes:
51
+ * - fast: Quick semantic search (default)
52
+ * - agentic: Iterative search with AI-powered refinement
53
+ *
54
+ * @param spaceId - The UUID of the space
55
+ * @param options - Search options
56
+ * @returns SpaceSearchResult containing cited blocks and optional final answer
57
+ */
58
+ async experienceSearch(spaceId, options) {
59
+ const params = (0, utils_1.buildParams)({
60
+ query: options.query,
61
+ limit: options.limit ?? null,
62
+ mode: options.mode ?? null,
63
+ semantic_threshold: options.semanticThreshold ?? null,
64
+ max_iterations: options.maxIterations ?? null,
65
+ });
66
+ const data = await this.requester.request('GET', `/space/${spaceId}/experience_search`, { params: Object.keys(params).length > 0 ? params : undefined });
67
+ return types_1.SpaceSearchResultSchema.parse(data);
68
+ }
69
+ /**
70
+ * Perform semantic global (glob) search for page/folder titles.
71
+ *
72
+ * Searches specifically for page/folder titles using semantic similarity,
73
+ * similar to a semantic version of the glob command.
74
+ *
75
+ * @param spaceId - The UUID of the space
76
+ * @param options - Search options
77
+ * @returns List of SearchResultBlockItem objects matching the query
78
+ */
79
+ async semanticGlobal(spaceId, options) {
80
+ const params = (0, utils_1.buildParams)({
81
+ query: options.query,
82
+ limit: options.limit ?? null,
83
+ threshold: options.threshold ?? null,
84
+ });
85
+ const data = await this.requester.request('GET', `/space/${spaceId}/semantic_global`, { params: Object.keys(params).length > 0 ? params : undefined });
86
+ return data.map((item) => types_1.SearchResultBlockItemSchema.parse(item));
87
+ }
88
+ /**
89
+ * Perform semantic grep search for content blocks.
90
+ *
91
+ * Searches through content blocks (actual text content) using semantic similarity,
92
+ * similar to a semantic version of the grep command.
93
+ *
94
+ * @param spaceId - The UUID of the space
95
+ * @param options - Search options
96
+ * @returns List of SearchResultBlockItem objects matching the query
97
+ */
98
+ async semanticGrep(spaceId, options) {
99
+ const params = (0, utils_1.buildParams)({
100
+ query: options.query,
101
+ limit: options.limit ?? null,
102
+ threshold: options.threshold ?? null,
103
+ });
104
+ const data = await this.requester.request('GET', `/space/${spaceId}/semantic_grep`, { params: Object.keys(params).length > 0 ? params : undefined });
105
+ return data.map((item) => types_1.SearchResultBlockItemSchema.parse(item));
106
+ }
47
107
  }
48
108
  exports.SpacesAPI = SpacesAPI;
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,26 @@
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;
@@ -5,3 +5,4 @@ export * from './space';
5
5
  export * from './session';
6
6
  export * from './disk';
7
7
  export * from './block';
8
+ export * from './tool';
@@ -21,3 +21,4 @@ __exportStar(require("./space"), exports);
21
21
  __exportStar(require("./session"), exports);
22
22
  __exportStar(require("./disk"), exports);
23
23
  __exportStar(require("./block"), exports);
24
+ __exportStar(require("./tool"), exports);
@@ -56,7 +56,7 @@ export declare const SessionSchema: z.ZodObject<{
56
56
  id: z.ZodString;
57
57
  project_id: z.ZodString;
58
58
  space_id: z.ZodNullable<z.ZodString>;
59
- configs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
59
+ configs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
60
60
  created_at: z.ZodString;
61
61
  updated_at: z.ZodString;
62
62
  }, z.core.$strip>;
@@ -79,7 +79,7 @@ export declare const ListSessionsOutputSchema: z.ZodObject<{
79
79
  id: z.ZodString;
80
80
  project_id: z.ZodString;
81
81
  space_id: z.ZodNullable<z.ZodString>;
82
- configs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
82
+ configs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
83
83
  created_at: z.ZodString;
84
84
  updated_at: z.ZodString;
85
85
  }, z.core.$strip>>;
@@ -36,7 +36,7 @@ exports.SessionSchema = zod_1.z.object({
36
36
  id: zod_1.z.string(),
37
37
  project_id: zod_1.z.string(),
38
38
  space_id: zod_1.z.string().nullable(),
39
- configs: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
39
+ configs: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable(),
40
40
  created_at: zod_1.z.string(),
41
41
  updated_at: zod_1.z.string(),
42
42
  });
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  export declare const SpaceSchema: z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  project_id: z.ZodString;
8
- configs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
8
+ configs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9
9
  created_at: z.ZodString;
10
10
  updated_at: z.ZodString;
11
11
  }, z.core.$strip>;
@@ -14,7 +14,7 @@ export declare const ListSpacesOutputSchema: z.ZodObject<{
14
14
  items: z.ZodArray<z.ZodObject<{
15
15
  id: z.ZodString;
16
16
  project_id: z.ZodString;
17
- configs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
17
+ configs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
18
  created_at: z.ZodString;
19
19
  updated_at: z.ZodString;
20
20
  }, z.core.$strip>>;
@@ -22,3 +22,22 @@ export declare const ListSpacesOutputSchema: z.ZodObject<{
22
22
  has_more: z.ZodBoolean;
23
23
  }, z.core.$strip>;
24
24
  export type ListSpacesOutput = z.infer<typeof ListSpacesOutputSchema>;
25
+ export declare const SearchResultBlockItemSchema: z.ZodObject<{
26
+ block_id: z.ZodString;
27
+ title: z.ZodString;
28
+ type: z.ZodString;
29
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
30
+ distance: z.ZodNullable<z.ZodNumber>;
31
+ }, z.core.$strip>;
32
+ export type SearchResultBlockItem = z.infer<typeof SearchResultBlockItemSchema>;
33
+ export declare const SpaceSearchResultSchema: z.ZodObject<{
34
+ cited_blocks: z.ZodArray<z.ZodObject<{
35
+ block_id: z.ZodString;
36
+ title: z.ZodString;
37
+ type: z.ZodString;
38
+ props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
39
+ distance: z.ZodNullable<z.ZodNumber>;
40
+ }, z.core.$strip>>;
41
+ final_answer: z.ZodNullable<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ export type SpaceSearchResult = z.infer<typeof SpaceSearchResultSchema>;
@@ -3,12 +3,12 @@
3
3
  * Type definitions for space resources.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ListSpacesOutputSchema = exports.SpaceSchema = void 0;
6
+ exports.SpaceSearchResultSchema = exports.SearchResultBlockItemSchema = exports.ListSpacesOutputSchema = exports.SpaceSchema = void 0;
7
7
  const zod_1 = require("zod");
8
8
  exports.SpaceSchema = zod_1.z.object({
9
9
  id: zod_1.z.string(),
10
10
  project_id: zod_1.z.string(),
11
- configs: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
11
+ configs: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable(),
12
12
  created_at: zod_1.z.string(),
13
13
  updated_at: zod_1.z.string(),
14
14
  });
@@ -17,3 +17,14 @@ exports.ListSpacesOutputSchema = zod_1.z.object({
17
17
  next_cursor: zod_1.z.string().nullable().optional(),
18
18
  has_more: zod_1.z.boolean(),
19
19
  });
20
+ exports.SearchResultBlockItemSchema = zod_1.z.object({
21
+ block_id: zod_1.z.string(),
22
+ title: zod_1.z.string(),
23
+ type: zod_1.z.string(),
24
+ props: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
25
+ distance: zod_1.z.number().nullable(),
26
+ });
27
+ exports.SpaceSearchResultSchema = zod_1.z.object({
28
+ cited_blocks: zod_1.z.array(exports.SearchResultBlockItemSchema),
29
+ final_answer: zod_1.z.string().nullable(),
30
+ });
@@ -0,0 +1,23 @@
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>;
20
+ export declare const InsertBlockResponseSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export type InsertBlockResponse = z.infer<typeof InsertBlockResponseSchema>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for tool resources.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InsertBlockResponseSchema = 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
+ });
20
+ exports.InsertBlockResponseSchema = zod_1.z.object({
21
+ id: zod_1.z.string(),
22
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acontext/acontext",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "TypeScript SDK for the Acontext API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",