@naylence/agent-sdk 0.3.11 → 0.3.13
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 +30 -0
- package/dist/browser/index.js +3268 -1913
- package/dist/browser/index.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +27 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/naylence/agent/agent-proxy.js.map +1 -1
- package/dist/cjs/naylence/agent/agent.js.map +1 -1
- package/dist/cjs/naylence/agent/background-task-agent.js.map +1 -1
- package/dist/cjs/naylence/agent/base-agent.js.map +1 -1
- package/dist/cjs/naylence/agent/configs.d.ts +12 -0
- package/dist/cjs/naylence/agent/configs.js +12 -0
- package/dist/cjs/naylence/agent/configs.js.map +1 -1
- package/dist/cjs/public-api.d.ts +7 -0
- package/dist/cjs/public-api.js +26 -0
- package/dist/cjs/public-api.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +31 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/naylence/agent/agent-proxy.d.ts +148 -0
- package/dist/esm/naylence/agent/agent-proxy.js +130 -0
- package/dist/esm/naylence/agent/agent-proxy.js.map +1 -1
- package/dist/esm/naylence/agent/agent.d.ts +194 -2
- package/dist/esm/naylence/agent/agent.js +123 -0
- package/dist/esm/naylence/agent/agent.js.map +1 -1
- package/dist/esm/naylence/agent/background-task-agent.d.ts +164 -0
- package/dist/esm/naylence/agent/background-task-agent.js +150 -0
- package/dist/esm/naylence/agent/background-task-agent.js.map +1 -1
- package/dist/esm/naylence/agent/base-agent.d.ts +171 -0
- package/dist/esm/naylence/agent/base-agent.js +170 -1
- package/dist/esm/naylence/agent/base-agent.js.map +1 -1
- package/dist/esm/naylence/agent/configs.d.ts +12 -0
- package/dist/esm/naylence/agent/configs.js +12 -0
- package/dist/esm/naylence/agent/configs.js.map +1 -1
- package/dist/esm/public-api.d.ts +15 -0
- package/dist/esm/public-api.js +16 -0
- package/dist/esm/public-api.js.map +1 -0
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/naylence/agent/agent-proxy.d.ts +148 -0
- package/dist/types/naylence/agent/agent-proxy.d.ts.map +1 -1
- package/dist/types/naylence/agent/agent.d.ts +194 -2
- package/dist/types/naylence/agent/agent.d.ts.map +1 -1
- package/dist/types/naylence/agent/background-task-agent.d.ts +164 -0
- package/dist/types/naylence/agent/background-task-agent.d.ts.map +1 -1
- package/dist/types/naylence/agent/base-agent.d.ts +171 -0
- package/dist/types/naylence/agent/base-agent.d.ts.map +1 -1
- package/dist/types/naylence/agent/configs.d.ts +12 -0
- package/dist/types/naylence/agent/configs.d.ts.map +1 -1
- package/dist/types/public-api.d.ts +16 -0
- package/dist/types/public-api.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +7 -2
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for implementing agents.
|
|
3
|
+
*
|
|
4
|
+
* {@link BaseAgent} provides the standard implementation of the {@link Agent} protocol
|
|
5
|
+
* with built-in support for state management, message handling, and task execution.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Extend this class for request-response style agents. For long-running background
|
|
9
|
+
* work, consider extending {@link BackgroundTaskAgent} instead.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
1
13
|
import { type FameDeliveryContext, type FameEnvelope, type FameMessageResponse } from '@naylence/core';
|
|
2
14
|
import { FameAddress, FameFabric, NodeLike, Registerable, type StorageProvider } from '@naylence/runtime';
|
|
3
15
|
import { z } from 'zod';
|
|
@@ -5,6 +17,7 @@ import { Agent, type Payload } from './agent.js';
|
|
|
5
17
|
import { type AgentCard, Task, type TaskArtifactUpdateEvent, TaskIdParams, TaskPushNotificationConfig, TaskQueryParams, TaskSendParams, TaskStatusUpdateEvent } from './a2a-types.js';
|
|
6
18
|
import { TERMINAL_TASK_STATES } from './task-states.js';
|
|
7
19
|
export { TERMINAL_TASK_STATES };
|
|
20
|
+
/** @internal */
|
|
8
21
|
declare class StateContext<StateT extends BaseAgentState> {
|
|
9
22
|
private readonly acquireLock;
|
|
10
23
|
private readonly loadState;
|
|
@@ -133,16 +146,73 @@ export declare class BaseAgentState {
|
|
|
133
146
|
*/
|
|
134
147
|
clone(): this;
|
|
135
148
|
}
|
|
149
|
+
/** @internal */
|
|
136
150
|
type StateModelCtor<T extends BaseAgentState> = new () => T;
|
|
151
|
+
/**
|
|
152
|
+
* Configuration options for {@link BaseAgent}.
|
|
153
|
+
*/
|
|
137
154
|
export interface BaseAgentOptions<StateT extends BaseAgentState> {
|
|
155
|
+
/** State model class for typed state management. */
|
|
138
156
|
stateModel?: StateModelCtor<StateT> | null;
|
|
157
|
+
/** Namespace for state storage. Defaults to agent name. */
|
|
139
158
|
stateNamespace?: string | null;
|
|
159
|
+
/** Key under which state is stored. Defaults to 'state'. */
|
|
140
160
|
stateKey?: string;
|
|
161
|
+
/** Factory function to create initial state. */
|
|
141
162
|
stateFactory?: (() => StateT) | null;
|
|
163
|
+
/** Custom storage provider for state persistence. */
|
|
142
164
|
storageProvider?: StorageProvider | null;
|
|
143
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Standard implementation of the {@link Agent} protocol.
|
|
168
|
+
*
|
|
169
|
+
* Provides built-in state management, message handling, and task lifecycle support.
|
|
170
|
+
* Extend this class and override {@link BaseAgent.runTask} to implement your agent logic.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* BaseAgent handles:
|
|
174
|
+
* - JSON-RPC message routing
|
|
175
|
+
* - State persistence with optional Zod validation
|
|
176
|
+
* - Task creation from runTask results
|
|
177
|
+
* - Graceful shutdown via SIGINT/SIGTERM
|
|
178
|
+
*
|
|
179
|
+
* For background/async task execution, use {@link BackgroundTaskAgent} instead.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* import { BaseAgent, Payload, BaseAgentState } from '@naylence/agent-sdk';
|
|
184
|
+
* import { z } from 'zod';
|
|
185
|
+
*
|
|
186
|
+
* const CounterSchema = z.object({ count: z.number() });
|
|
187
|
+
*
|
|
188
|
+
* class CounterState extends BaseAgentState {
|
|
189
|
+
* static readonly schema = CounterSchema;
|
|
190
|
+
* count = 0;
|
|
191
|
+
* }
|
|
192
|
+
*
|
|
193
|
+
* class CounterAgent extends BaseAgent<CounterState> {
|
|
194
|
+
* static STATE_MODEL = CounterState;
|
|
195
|
+
*
|
|
196
|
+
* async runTask(payload: Payload): Promise<number> {
|
|
197
|
+
* return await this.withState(async (state) => {
|
|
198
|
+
* state.count += 1;
|
|
199
|
+
* return state.count;
|
|
200
|
+
* });
|
|
201
|
+
* }
|
|
202
|
+
* }
|
|
203
|
+
*
|
|
204
|
+
* const agent = new CounterAgent('counter');
|
|
205
|
+
* await agent.serve('fame://counter');
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* @typeParam StateT - The state model type, defaults to {@link BaseAgentState}.
|
|
209
|
+
*/
|
|
144
210
|
export declare class BaseAgent<StateT extends BaseAgentState = BaseAgentState> extends Agent implements Registerable {
|
|
145
211
|
#private;
|
|
212
|
+
/**
|
|
213
|
+
* Default state model class. Override in subclasses to set state type.
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
146
216
|
static STATE_MODEL: StateModelCtor<BaseAgentState> | null;
|
|
147
217
|
private _name;
|
|
148
218
|
private _address;
|
|
@@ -158,12 +228,29 @@ export declare class BaseAgent<StateT extends BaseAgentState = BaseAgentState> e
|
|
|
158
228
|
private _fabric;
|
|
159
229
|
private _stateStore;
|
|
160
230
|
private _stateCache;
|
|
231
|
+
/**
|
|
232
|
+
* Creates a new BaseAgent.
|
|
233
|
+
*
|
|
234
|
+
* @param name - Agent name. Defaults to snake_case of the class name.
|
|
235
|
+
* @param options - Configuration options for state and storage.
|
|
236
|
+
*/
|
|
161
237
|
constructor(name?: string | null, options?: BaseAgentOptions<StateT>);
|
|
238
|
+
/**
|
|
239
|
+
* Capabilities advertised by this agent.
|
|
240
|
+
* Includes the standard agent capability by default.
|
|
241
|
+
*/
|
|
162
242
|
get capabilities(): string[];
|
|
243
|
+
/** The agent's name. */
|
|
163
244
|
get name(): string | null;
|
|
164
245
|
get spec(): Record<string, unknown>;
|
|
246
|
+
/** The address this agent is registered at. */
|
|
165
247
|
get address(): FameAddress | null;
|
|
248
|
+
/** @internal */
|
|
166
249
|
set address(value: FameAddress | null);
|
|
250
|
+
/**
|
|
251
|
+
* Storage provider for state persistence.
|
|
252
|
+
* @throws Error if no storage provider is available.
|
|
253
|
+
*/
|
|
167
254
|
get storageProvider(): StorageProvider;
|
|
168
255
|
/**
|
|
169
256
|
* Returns the fabric this agent is registered with.
|
|
@@ -172,21 +259,74 @@ export declare class BaseAgent<StateT extends BaseAgentState = BaseAgentState> e
|
|
|
172
259
|
*/
|
|
173
260
|
protected get fabric(): FameFabric | null;
|
|
174
261
|
onRegister?(node: NodeLike): Promise<void>;
|
|
262
|
+
/** @internal */
|
|
175
263
|
protected acquireStateLock(): Promise<() => void>;
|
|
264
|
+
/** @internal */
|
|
176
265
|
private ensureStateModel;
|
|
266
|
+
/** @internal */
|
|
177
267
|
private ensureStateStore;
|
|
268
|
+
/** @internal */
|
|
178
269
|
private defaultStateNamespace;
|
|
270
|
+
/** @internal */
|
|
179
271
|
protected loadStateInternal(): Promise<StateT>;
|
|
272
|
+
/** @internal */
|
|
180
273
|
protected saveStateInternal(state: StateT): Promise<void>;
|
|
274
|
+
/**
|
|
275
|
+
* State context for lock-protected state access.
|
|
276
|
+
*
|
|
277
|
+
* @remarks
|
|
278
|
+
* Prefer using {@link BaseAgent.withState} for simpler access patterns.
|
|
279
|
+
*
|
|
280
|
+
* @throws Error if no state model is configured.
|
|
281
|
+
*/
|
|
181
282
|
get state(): StateContext<StateT>;
|
|
283
|
+
/**
|
|
284
|
+
* Executes a callback with exclusive access to the agent's state.
|
|
285
|
+
*
|
|
286
|
+
* State changes are automatically persisted after the callback completes.
|
|
287
|
+
*
|
|
288
|
+
* @param callback - Function receiving the current state.
|
|
289
|
+
* @returns The callback's return value.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* const count = await this.withState(async (state) => {
|
|
294
|
+
* state.count += 1;
|
|
295
|
+
* return state.count;
|
|
296
|
+
* });
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
182
299
|
withState<T>(callback: (state: StateT) => Promise<T>): Promise<T>;
|
|
300
|
+
/**
|
|
301
|
+
* Retrieves a snapshot of the current state.
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* Returns a point-in-time copy. For modifications, use {@link BaseAgent.withState}.
|
|
305
|
+
*/
|
|
183
306
|
getState(): Promise<StateT>;
|
|
307
|
+
/**
|
|
308
|
+
* Deletes all persisted state for this agent.
|
|
309
|
+
*/
|
|
184
310
|
clearState(): Promise<void>;
|
|
311
|
+
/** @internal */
|
|
185
312
|
private static isRpcRequest;
|
|
313
|
+
/** @internal */
|
|
186
314
|
handleMessage(envelope: FameEnvelope, _context?: FameDeliveryContext): Promise<FameMessageResponse | AsyncIterable<FameMessageResponse> | null | void>;
|
|
315
|
+
/**
|
|
316
|
+
* Override to handle non-RPC messages.
|
|
317
|
+
*
|
|
318
|
+
* Called when the agent receives a message that is not a JSON-RPC request.
|
|
319
|
+
* The default implementation logs a warning and returns null.
|
|
320
|
+
*
|
|
321
|
+
* @param message - The decoded message payload.
|
|
322
|
+
* @returns Optional response to send back.
|
|
323
|
+
*/
|
|
187
324
|
onMessage(message: unknown): Promise<FameMessageResponse | null | void>;
|
|
325
|
+
/** @internal */
|
|
188
326
|
private handleRpcMessage;
|
|
327
|
+
/** @internal */
|
|
189
328
|
private startSubscriptionTask;
|
|
329
|
+
/** @internal */
|
|
190
330
|
private streamSendSubscribe;
|
|
191
331
|
authenticate(_credentials: unknown): boolean;
|
|
192
332
|
registerPushEndpoint(_config: TaskPushNotificationConfig): Promise<TaskPushNotificationConfig>;
|
|
@@ -196,7 +336,38 @@ export declare class BaseAgent<StateT extends BaseAgentState = BaseAgentState> e
|
|
|
196
336
|
cancelTask(_params: TaskIdParams): Promise<Task>;
|
|
197
337
|
getAgentCard(): Promise<AgentCard>;
|
|
198
338
|
getTaskStatus(_params: TaskQueryParams): Promise<Task>;
|
|
339
|
+
/**
|
|
340
|
+
* Override to implement task execution logic.
|
|
341
|
+
*
|
|
342
|
+
* This is the primary extension point for agent behavior. Return the task result
|
|
343
|
+
* or throw an error to fail the task.
|
|
344
|
+
*
|
|
345
|
+
* @param _payload - The task payload.
|
|
346
|
+
* @param _id - Optional task identifier.
|
|
347
|
+
* @returns The task result.
|
|
348
|
+
* @throws UnsupportedOperationException if not overridden.
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* ```typescript
|
|
352
|
+
* async runTask(payload: Payload): Promise<string> {
|
|
353
|
+
* const input = typeof payload === 'string' ? payload : '';
|
|
354
|
+
* return `Hello, ${input}!`;
|
|
355
|
+
* }
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
199
358
|
runTask(_payload: Payload, _id: string | null): Promise<unknown>;
|
|
359
|
+
/**
|
|
360
|
+
* Initiates a task and returns its status.
|
|
361
|
+
*
|
|
362
|
+
* @remarks
|
|
363
|
+
* If you override {@link BaseAgent.runTask}, this method automatically
|
|
364
|
+
* creates a Task from the result. Override this method for custom
|
|
365
|
+
* task lifecycle management.
|
|
366
|
+
*
|
|
367
|
+
* @param params - Task parameters including message and metadata.
|
|
368
|
+
* @returns The completed task with result.
|
|
369
|
+
* @throws Error if neither startTask nor runTask is implemented.
|
|
370
|
+
*/
|
|
200
371
|
startTask(params: TaskSendParams): Promise<Task>;
|
|
201
372
|
aserve(address: FameAddress | string, options?: Parameters<Agent['aserve']>[1]): Promise<void>;
|
|
202
373
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-agent.d.ts","sourceRoot":"","sources":["../../../../src/naylence/agent/base-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,WAAW,EACX,UAAU,EAIV,QAAQ,EACR,YAAY,EAEZ,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,EAEL,KAAK,OAAO,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,SAAS,EACd,IAAI,EACJ,KAAK,uBAAuB,EAC5B,YAAY,EACZ,0BAA0B,EAC1B,eAAe,EACf,cAAc,EAEd,qBAAqB,EAEtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAWxD,OAAO,EAAE,oBAAoB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"base-agent.d.ts","sourceRoot":"","sources":["../../../../src/naylence/agent/base-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,WAAW,EACX,UAAU,EAIV,QAAQ,EACR,YAAY,EAEZ,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,EAEL,KAAK,OAAO,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,SAAS,EACd,IAAI,EACJ,KAAK,uBAAuB,EAC5B,YAAY,EACZ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,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAQtE;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAkDhD,MAAM,CACV,OAAO,EAAE,WAAW,GAAG,MAAM,EAC7B,OAAO,GAAE,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAM,GAC3C,OAAO,CAAC,IAAI,CAAC;CAMjB"}
|
|
@@ -10,6 +10,10 @@ export declare const CLIENT_CONFIG: {
|
|
|
10
10
|
readonly type: "AdmissionProfile";
|
|
11
11
|
readonly profile: "${env:FAME_ADMISSION_PROFILE:open}";
|
|
12
12
|
};
|
|
13
|
+
readonly identity_policy: {
|
|
14
|
+
readonly type: "NodeIdentityPolicyProfile";
|
|
15
|
+
readonly profile: "${env:FAME_NODE_IDENTITY_PROFILE:default}";
|
|
16
|
+
};
|
|
13
17
|
readonly storage: {
|
|
14
18
|
readonly type: "StorageProfile";
|
|
15
19
|
readonly profile: "${env:FAME_STORAGE_PROFILE:memory}";
|
|
@@ -35,6 +39,10 @@ export declare const NODE_CONFIG: {
|
|
|
35
39
|
readonly type: "AdmissionProfile";
|
|
36
40
|
readonly profile: "${env:FAME_ADMISSION_PROFILE:open}";
|
|
37
41
|
};
|
|
42
|
+
readonly identity_policy: {
|
|
43
|
+
readonly type: "NodeIdentityPolicyProfile";
|
|
44
|
+
readonly profile: "${env:FAME_NODE_IDENTITY_PROFILE:default}";
|
|
45
|
+
};
|
|
38
46
|
readonly storage: {
|
|
39
47
|
readonly type: "StorageProfile";
|
|
40
48
|
readonly profile: "${env:FAME_STORAGE_PROFILE:memory}";
|
|
@@ -67,6 +75,10 @@ export declare const SENTINEL_CONFIG: {
|
|
|
67
75
|
readonly type: "AdmissionProfile";
|
|
68
76
|
readonly profile: "${env:FAME_ADMISSION_PROFILE:none}";
|
|
69
77
|
};
|
|
78
|
+
readonly identity_policy: {
|
|
79
|
+
readonly type: "NodeIdentityPolicyProfile";
|
|
80
|
+
readonly profile: "${env:FAME_NODE_IDENTITY_PROFILE:default}";
|
|
81
|
+
};
|
|
70
82
|
readonly storage: {
|
|
71
83
|
readonly type: "StorageProfile";
|
|
72
84
|
readonly profile: "${env:FAME_STORAGE_PROFILE:memory}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/naylence/agent/configs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,OAAO,CAAC;AAqDlC,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/naylence/agent/configs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,OAAO,CAAC;AAqDlC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAwBhB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Bd,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsClB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API entrypoint for documentation generation.
|
|
3
|
+
*
|
|
4
|
+
* This file exports only the curated public surface of the Naylence Agent SDK.
|
|
5
|
+
* It is used by TypeDoc to generate API reference documentation.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export * from './naylence/agent/a2a-types.js';
|
|
10
|
+
export * from './naylence/agent/agent.js';
|
|
11
|
+
export * from './naylence/agent/base-agent.js';
|
|
12
|
+
export * from './naylence/agent/background-task-agent.js';
|
|
13
|
+
export { AgentProxy } from './naylence/agent/agent-proxy.js';
|
|
14
|
+
export * from './naylence/agent/errors.js';
|
|
15
|
+
export * from './naylence/agent/configs.js';
|
|
16
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naylence/agent-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Naylence Agent SDK for TypeScript",
|
|
6
6
|
"author": "Naylence Dev <naylencedev@gmail.com>",
|
|
@@ -71,13 +71,16 @@
|
|
|
71
71
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
72
72
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
73
73
|
"dev": "tsc --watch --outDir dist/esm",
|
|
74
|
+
"docs:clean": "rimraf docs/reference/ts/_generated",
|
|
75
|
+
"docs:gen": "typedoc",
|
|
76
|
+
"docs": "npm run docs:clean && npm run docs:gen",
|
|
74
77
|
"inject-version": "node ./scripts/inject-version.js",
|
|
75
78
|
"prebuild": "npm run inject-version",
|
|
76
79
|
"predev": "npm run inject-version",
|
|
77
80
|
"prepublishOnly": "npm run build && npm test"
|
|
78
81
|
},
|
|
79
82
|
"dependencies": {
|
|
80
|
-
"@naylence/runtime": "^0.3.
|
|
83
|
+
"@naylence/runtime": "^0.3.16",
|
|
81
84
|
"zod": "^4.1.11"
|
|
82
85
|
},
|
|
83
86
|
"peerDependencies": {
|
|
@@ -107,6 +110,8 @@
|
|
|
107
110
|
"ts-jest": "^29.4.4",
|
|
108
111
|
"tslib": "^2.6.2",
|
|
109
112
|
"tsx": "^4.20.6",
|
|
113
|
+
"typedoc": "^0.28.15",
|
|
114
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
110
115
|
"typescript": "^5.3.2"
|
|
111
116
|
},
|
|
112
117
|
"engines": {
|