@inferencesh/sdk 0.6.0 → 0.6.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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient } from '../http/client';
2
2
  import { FilesAPI } from './files';
3
- import { ChatDTO, ChatMessageDTO, AgentConfig, AgentDTO, AgentVersionDTO, CreateAgentRequest, File, CursorListRequest, CursorListResponse } from '../types';
3
+ import { ChatDTO, ChatMessageDTO, AgentConfig, AgentDTO, AgentVersionDTO, CreateAgentRequest, FileDTO as File, CursorListRequest, CursorListResponse } from '../types';
4
4
  /** Internal tool definition returned by getInternalTools */
5
5
  export interface InternalToolDefinition {
6
6
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
- import { AppDTO as App, AppVersionDTO, CursorListRequest, CursorListResponse, LicenseRecord } from '../types';
2
+ import { AppDTO as App, AppVersionDTO, CursorListRequest, CursorListResponse, LicenseRecordDTO } from '../types';
3
3
  /**
4
4
  * Apps API
5
5
  */
@@ -53,11 +53,11 @@ export declare class AppsAPI {
53
53
  /**
54
54
  * Get app license record
55
55
  */
56
- getLicense(appId: string): Promise<LicenseRecord>;
56
+ getLicense(appId: string): Promise<LicenseRecordDTO>;
57
57
  /**
58
58
  * Save app license
59
59
  */
60
- saveLicense(appId: string, license: string): Promise<LicenseRecord>;
60
+ saveLicense(appId: string, license: string): Promise<LicenseRecordDTO>;
61
61
  /**
62
62
  * Set the current (active) version of an app
63
63
  */
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
- import { File, CursorListRequest, CursorListResponse } from '../types';
2
+ import { FileDTO as File, CursorListRequest, CursorListResponse } from '../types';
3
3
  export interface UploadFileOptions {
4
4
  filename?: string;
5
5
  contentType?: string;
@@ -2,7 +2,7 @@
2
2
  * Sessions API - namespaced session operations.
3
3
  */
4
4
  import { HttpClient } from '../http/client';
5
- import { AppSession } from '../types';
5
+ import { AppSessionDTO } from '../types';
6
6
  /**
7
7
  * Sessions API for managing stateful worker leases.
8
8
  *
@@ -34,13 +34,13 @@ export declare class SessionsAPI {
34
34
  * @returns Session information
35
35
  * @throws SessionNotFoundError if session doesn't exist
36
36
  */
37
- get(sessionId: string): Promise<AppSession>;
37
+ get(sessionId: string): Promise<AppSessionDTO>;
38
38
  /**
39
39
  * List all sessions for the current user/team.
40
40
  *
41
41
  * @returns List of session information
42
42
  */
43
- list(): Promise<AppSession[]>;
43
+ list(): Promise<AppSessionDTO[]>;
44
44
  /**
45
45
  * Extend session expiration time.
46
46
  *
@@ -52,7 +52,7 @@ export declare class SessionsAPI {
52
52
  * @throws SessionExpiredError if session has expired
53
53
  * @throws SessionEndedError if session was ended
54
54
  */
55
- keepalive(sessionId: string): Promise<AppSession>;
55
+ keepalive(sessionId: string): Promise<AppSessionDTO>;
56
56
  /**
57
57
  * End a session and release the worker.
58
58
  *
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ import { ChatsAPI } from './api/chats';
27
27
  import { FlowsAPI } from './api/flows';
28
28
  import { FlowRunsAPI } from './api/flow-runs';
29
29
  import { EnginesAPI } from './api/engines';
30
- import { ApiAppRunRequest, TaskDTO as Task, AgentConfig, File } from './types';
30
+ import { ApiAppRunRequest, TaskDTO as Task, AgentConfig, FileDTO as File } from './types';
31
31
  export interface InferenceConfig {
32
32
  /** Your inference.sh API key (required unless using proxyUrl) */
33
33
  apiKey?: string;
package/dist/types.d.ts CHANGED
@@ -114,6 +114,11 @@ export interface ToolAuthConfig {
114
114
  */
115
115
  header?: string;
116
116
  }
117
+ /**
118
+ * CallToolConfig is the preferred name for HTTPToolConfig.
119
+ * "call" is the user-facing type; "http" is kept for backward compatibility.
120
+ */
121
+ export type CallToolConfig = HTTPToolConfig;
117
122
  /**
118
123
  * HTTPToolConfig contains configuration for an authenticated HTTP tool
119
124
  */
@@ -159,6 +164,7 @@ export interface AgentTool {
159
164
  agent?: AgentToolConfig;
160
165
  hook?: HookToolConfig;
161
166
  http?: HTTPToolConfig;
167
+ call?: CallToolConfig;
162
168
  mcp?: MCPToolConfig;
163
169
  client?: ClientToolConfig;
164
170
  internal?: InternalToolConfig;
@@ -186,6 +192,7 @@ export interface AgentToolDTO {
186
192
  agent?: AgentToolConfigDTO;
187
193
  hook?: HookToolConfigDTO;
188
194
  http?: HTTPToolConfigDTO;
195
+ call?: HTTPToolConfigDTO;
189
196
  mcp?: MCPToolConfigDTO;
190
197
  client?: ClientToolConfigDTO;
191
198
  }
@@ -282,7 +289,7 @@ export interface Agent extends BaseModel, PermissionModel {
282
289
  /**
283
290
  * AgentDTO for API responses
284
291
  */
285
- export interface AgentDTO extends BaseModel, PermissionModelDTO, ProjectModelDTO {
292
+ export interface AgentDTO extends BaseModelDTO, PermissionModelDTO, ProjectModelDTO {
286
293
  namespace: string;
287
294
  name: string;
288
295
  /**
@@ -303,6 +310,17 @@ export interface SkillConfig {
303
310
  version_id?: string;
304
311
  url?: string;
305
312
  content?: string;
313
+ preload?: boolean;
314
+ }
315
+ /**
316
+ * ContextField declares a context parameter expected by the agent.
317
+ * Context is caller-provided at chat creation, stored on Chat, and available in tool URL templates.
318
+ */
319
+ export interface ContextField {
320
+ name: string;
321
+ description?: string;
322
+ required?: boolean;
323
+ default?: string;
306
324
  }
307
325
  /**
308
326
  * AgentConfig contains the shared configuration fields for agent execution.
@@ -330,6 +348,10 @@ export interface AgentConfig {
330
348
  * Skills available to this agent (loaded on-demand via skill_get tool)
331
349
  */
332
350
  skills?: SkillConfig[];
351
+ /**
352
+ * Context declares expected context parameters (resolved in tool URL templates via {{context.X}})
353
+ */
354
+ context?: ContextField[];
333
355
  /**
334
356
  * Internal tools configuration (plan, memory, widget, finish, skills)
335
357
  */
@@ -360,7 +382,7 @@ export interface CoreAppConfigDTO {
360
382
  */
361
383
  input?: any;
362
384
  }
363
- export interface AgentVersionDTO extends BaseModel, PermissionModelDTO {
385
+ export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
364
386
  description: string;
365
387
  system_prompt: string;
366
388
  example_prompts: string[];
@@ -373,6 +395,10 @@ export interface AgentVersionDTO extends BaseModel, PermissionModelDTO {
373
395
  * Skills available to this agent (loaded on-demand via skill_get tool)
374
396
  */
375
397
  skills: SkillConfig[];
398
+ /**
399
+ * Context declarations
400
+ */
401
+ context?: ContextField[];
376
402
  /**
377
403
  * Internal tools configuration (plan, memory, widget, finish, skills)
378
404
  */
@@ -484,6 +510,12 @@ export interface ApiAgentRunRequest {
484
510
  * The message to send
485
511
  */
486
512
  input: ChatTaskInput;
513
+ /**
514
+ * Context values for this chat session (used in tool URL templates)
515
+ */
516
+ context?: {
517
+ [key: string]: string;
518
+ };
487
519
  /**
488
520
  * If true, returns SSE stream instead of JSON response
489
521
  */
@@ -516,6 +548,12 @@ export interface CreateAgentMessageRequest {
516
548
  * Optional name for the adhoc agent (used for deduplication and display)
517
549
  */
518
550
  agent_name?: string;
551
+ /**
552
+ * Context values for this chat session (used in tool URL templates)
553
+ */
554
+ context?: {
555
+ [key: string]: string;
556
+ };
519
557
  }
520
558
  export interface CreateAgentMessageResponse {
521
559
  user_message?: ChatMessageDTO;
@@ -594,7 +632,15 @@ export interface CreateFlowRunRequest {
594
632
  /**
595
633
  * CreateAppRequest is the request body for POST /apps
596
634
  */
597
- export interface CreateAppRequest extends App {
635
+ export interface CreateAppRequest {
636
+ id?: string;
637
+ namespace?: string;
638
+ name: string;
639
+ description?: string;
640
+ agent_description?: string;
641
+ category?: AppCategory;
642
+ images?: AppImages;
643
+ version?: AppVersion;
598
644
  /**
599
645
  * PreserveCurrentVersion prevents auto-promoting the new version to current.
600
646
  * Default false = new versions become current (what most users expect).
@@ -967,7 +1013,7 @@ export interface App extends BaseModel, PermissionModel {
967
1013
  }
968
1014
  /**
969
1015
  * AppPricing configures all pricing using CEL expressions
970
- * Empty expressions use defaults. All values in nanocents (1 cent = 1,000,000,000)
1016
+ * Empty expressions use defaults. All values in microcents (1 cent = 1,000,000; 1 dollar = 100,000,000)
971
1017
  */
972
1018
  export interface AppPricing {
973
1019
  prices: {
@@ -981,7 +1027,7 @@ export interface AppPricing {
981
1027
  */
982
1028
  resource_expression: string;
983
1029
  /**
984
- * CEL expressions for each fee type (result in nanocents)
1030
+ * CEL expressions for each fee type (result in microcents)
985
1031
  * Available variables: inputs, outputs, prices, resource_fee, usage_seconds
986
1032
  */
987
1033
  inference_expression: string;
@@ -1068,12 +1114,12 @@ export interface AppVersion extends BaseModel {
1068
1114
  */
1069
1115
  checksum?: string;
1070
1116
  }
1071
- export interface LicenseRecord extends BaseModel {
1117
+ export interface LicenseRecordDTO extends BaseModelDTO {
1072
1118
  user_id: string;
1073
1119
  app_id: string;
1074
1120
  license: string;
1075
1121
  }
1076
- export interface AppDTO extends BaseModel, PermissionModelDTO {
1122
+ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1077
1123
  namespace: string;
1078
1124
  name: string;
1079
1125
  description: string;
@@ -1083,7 +1129,7 @@ export interface AppDTO extends BaseModel, PermissionModelDTO {
1083
1129
  version_id: string;
1084
1130
  version?: AppVersionDTO;
1085
1131
  }
1086
- export interface AppVersionDTO extends BaseModel {
1132
+ export interface AppVersionDTO extends BaseModelDTO {
1087
1133
  metadata: {
1088
1134
  [key: string]: any;
1089
1135
  };
@@ -1119,37 +1165,20 @@ export type AppSessionStatus = string;
1119
1165
  export declare const AppSessionStatusActive: AppSessionStatus;
1120
1166
  export declare const AppSessionStatusEnded: AppSessionStatus;
1121
1167
  export declare const AppSessionStatusExpired: AppSessionStatus;
1122
- export interface AppSession extends BaseModel, PermissionModel {
1123
- /**
1124
- * Affinity binding
1125
- */
1168
+ /**
1169
+ * AppSessionDTO is the external representation
1170
+ */
1171
+ export interface AppSessionDTO extends BaseModelDTO, PermissionModelDTO {
1126
1172
  worker_id: string;
1127
1173
  app_id: string;
1128
1174
  app_version_id: string;
1129
- /**
1130
- * Lifecycle
1131
- */
1132
1175
  status: AppSessionStatus;
1133
1176
  expires_at: string;
1134
1177
  ended_at?: string;
1135
- /**
1136
- * Billing link
1137
- */
1138
1178
  task_id?: string;
1139
- /**
1140
- * Stats
1141
- */
1142
1179
  call_count: number;
1143
1180
  last_call_at?: string;
1144
- /**
1145
- * Custom idle timeout in seconds (nil = use default)
1146
- */
1147
1181
  idle_timeout?: number;
1148
- /**
1149
- * Relations
1150
- */
1151
- worker?: WorkerState;
1152
- task?: Task;
1153
1182
  }
1154
1183
  /**
1155
1184
  * PublicAppStoreDTO is a lean DTO for public app store display.
@@ -1175,6 +1204,17 @@ export interface BaseModel {
1175
1204
  updated_at: string;
1176
1205
  deleted_at?: string;
1177
1206
  }
1207
+ /**
1208
+ * BaseModelDTO is the contract-layer base embed — same fields, no gorm tags.
1209
+ * All DTOs should embed this instead of BaseModel.
1210
+ */
1211
+ export interface BaseModelDTO {
1212
+ id: string;
1213
+ short_id: string;
1214
+ created_at: string;
1215
+ updated_at: string;
1216
+ deleted_at?: string;
1217
+ }
1178
1218
  /**
1179
1219
  * Visibility represents the visibility level of a resource
1180
1220
  */
@@ -1332,12 +1372,15 @@ export interface ChatTaskContextMessage {
1332
1372
  tool_calls?: ToolCall[];
1333
1373
  tool_call_id?: string;
1334
1374
  }
1335
- export interface ChatDTO extends BaseModel, PermissionModelDTO {
1375
+ export interface ChatDTO extends BaseModelDTO, PermissionModelDTO {
1336
1376
  parent_id?: string;
1337
1377
  parent?: ChatDTO;
1338
1378
  children: (ChatDTO | undefined)[];
1339
1379
  status: ChatStatus;
1340
1380
  output?: any;
1381
+ context?: {
1382
+ [key: string]: string;
1383
+ };
1341
1384
  /**
1342
1385
  * Agent version reference
1343
1386
  */
@@ -1350,7 +1393,7 @@ export interface ChatDTO extends BaseModel, PermissionModelDTO {
1350
1393
  chat_messages: ChatMessageDTO[];
1351
1394
  agent_data: ChatData;
1352
1395
  }
1353
- export interface ChatMessageDTO extends BaseModel, PermissionModelDTO {
1396
+ export interface ChatMessageDTO extends BaseModelDTO, PermissionModelDTO {
1354
1397
  chat_id: string;
1355
1398
  chat?: ChatDTO;
1356
1399
  order: number;
@@ -1459,18 +1502,7 @@ export declare const EngineStatusPending: EngineStatus;
1459
1502
  export declare const EngineStatusDraining: EngineStatus;
1460
1503
  export declare const EngineStatusStopping: EngineStatus;
1461
1504
  export declare const EngineStatusStopped: EngineStatus;
1462
- export interface EngineState extends BaseModel, PermissionModel {
1463
- instance?: Instance;
1464
- transaction_id: string;
1465
- config: EngineConfig;
1466
- public_key: string;
1467
- name: string;
1468
- api_url: string;
1469
- status: EngineStatus;
1470
- system_info?: SystemInfo;
1471
- workers: (WorkerState | undefined)[];
1472
- }
1473
- export interface EngineStateDTO extends BaseModel, PermissionModelDTO {
1505
+ export interface EngineStateDTO extends BaseModelDTO, PermissionModelDTO {
1474
1506
  instance?: Instance;
1475
1507
  config: EngineConfig;
1476
1508
  name: string;
@@ -1479,7 +1511,7 @@ export interface EngineStateDTO extends BaseModel, PermissionModelDTO {
1479
1511
  system_info?: SystemInfo;
1480
1512
  workers: (WorkerStateDTO | undefined)[];
1481
1513
  }
1482
- export interface EngineStateSummary extends BaseModel, PermissionModelDTO {
1514
+ export interface EngineStateSummary extends BaseModelDTO, PermissionModelDTO {
1483
1515
  instance?: Instance;
1484
1516
  name: string;
1485
1517
  status: EngineStatus;
@@ -1489,31 +1521,6 @@ export interface EngineStateSummary extends BaseModel, PermissionModelDTO {
1489
1521
  * Worker-related types
1490
1522
  */
1491
1523
  export type WorkerStatus = string;
1492
- export interface WorkerState extends BaseModel, PermissionModel {
1493
- index: number;
1494
- status: WorkerStatus;
1495
- status_updated_at?: string;
1496
- heartbeat_at?: string;
1497
- engine_id: string;
1498
- engine?: EngineState;
1499
- task_id?: string;
1500
- app_id: string;
1501
- app_version_id: string;
1502
- /**
1503
- * App session lease
1504
- */
1505
- active_session_id?: string;
1506
- active_session?: AppSession;
1507
- gpus: WorkerGPU[];
1508
- cpus: WorkerCPU[];
1509
- rams: WorkerRAM[];
1510
- /**
1511
- * WarmApps tracks app+version combos with warm containers for scheduling optimization.
1512
- * Format: "appID:versionID@setupHash" - managed by Engine, synced via heartbeat.
1513
- * Not persisted to DB - this is ephemeral runtime state.
1514
- */
1515
- warm_apps?: string[];
1516
- }
1517
1524
  export interface WorkerGPU {
1518
1525
  id: string;
1519
1526
  worker_id: string;
@@ -1537,7 +1544,7 @@ export interface WorkerRAM {
1537
1544
  worker_id: string;
1538
1545
  total: number;
1539
1546
  }
1540
- export interface WorkerStateDTO extends BaseModel {
1547
+ export interface WorkerStateDTO extends BaseModelDTO {
1541
1548
  user_id: string;
1542
1549
  team_id: string;
1543
1550
  index: number;
@@ -1581,19 +1588,7 @@ export interface FileMetadata {
1581
1588
  channels?: number;
1582
1589
  codec?: string;
1583
1590
  }
1584
- export interface File extends BaseModel, PermissionModel {
1585
- path: string;
1586
- remote_path: string;
1587
- upload_url: string;
1588
- uri: string;
1589
- content_type: string;
1590
- size: number;
1591
- filename: string;
1592
- category: string;
1593
- rating: ContentRating;
1594
- metadata?: FileMetadata;
1595
- }
1596
- export interface FileDTO extends BaseModel, PermissionModelDTO {
1591
+ export interface FileDTO extends BaseModelDTO, PermissionModelDTO {
1597
1592
  path: string;
1598
1593
  remote_path: string;
1599
1594
  upload_url: string;
@@ -1688,7 +1683,7 @@ export interface OutputFieldMapping {
1688
1683
  export type OutputMappings = {
1689
1684
  [key: string]: OutputFieldMapping;
1690
1685
  };
1691
- export interface FlowDTO extends BaseModel, PermissionModelDTO {
1686
+ export interface FlowDTO extends BaseModelDTO, PermissionModelDTO {
1692
1687
  name: string;
1693
1688
  description: string;
1694
1689
  card_image: string;
@@ -1714,7 +1709,7 @@ export interface FlowDTO extends BaseModel, PermissionModelDTO {
1714
1709
  edges: FlowEdge[];
1715
1710
  viewport?: FlowViewport;
1716
1711
  }
1717
- export interface FlowVersionDTO extends BaseModel {
1712
+ export interface FlowVersionDTO extends BaseModelDTO {
1718
1713
  graph_version: number;
1719
1714
  input_schema: any;
1720
1715
  input: FlowRunInputs;
@@ -1736,7 +1731,7 @@ export declare const FlowRunStatusRunning: FlowRunStatus;
1736
1731
  export declare const FlowRunStatusCompleted: FlowRunStatus;
1737
1732
  export declare const FlowRunStatusFailed: FlowRunStatus;
1738
1733
  export declare const FlowRunStatusCancelled: FlowRunStatus;
1739
- export interface FlowRunDTO extends BaseModel, PermissionModelDTO {
1734
+ export interface FlowRunDTO extends BaseModelDTO, PermissionModelDTO {
1740
1735
  flow_id: string;
1741
1736
  flow_version_id: string;
1742
1737
  flow_version?: FlowVersionDTO;
@@ -1806,7 +1801,7 @@ export declare const GraphEdgeTypeDuplicate: GraphEdgeType;
1806
1801
  /**
1807
1802
  * GraphNodeDTO is the API representation of a graph node
1808
1803
  */
1809
- export interface GraphNodeDTO extends BaseModel {
1804
+ export interface GraphNodeDTO extends BaseModelDTO {
1810
1805
  graph_id: string;
1811
1806
  type: GraphNodeType;
1812
1807
  label: string;
@@ -1822,7 +1817,7 @@ export interface GraphNodeDTO extends BaseModel {
1822
1817
  /**
1823
1818
  * GraphEdgeDTO is the API representation of a graph edge
1824
1819
  */
1825
- export interface GraphEdgeDTO extends BaseModel {
1820
+ export interface GraphEdgeDTO extends BaseModelDTO {
1826
1821
  type: GraphEdgeType;
1827
1822
  from_node: string;
1828
1823
  to_node: string;
@@ -1849,7 +1844,7 @@ export type StringSlice = string[];
1849
1844
  /**
1850
1845
  * IntegrationDTO for API responses (never exposes tokens)
1851
1846
  */
1852
- export interface IntegrationDTO extends BaseModel, PermissionModelDTO {
1847
+ export interface IntegrationDTO extends BaseModelDTO, PermissionModelDTO {
1853
1848
  provider: string;
1854
1849
  type: string;
1855
1850
  auth: string;
@@ -1914,7 +1909,7 @@ export type PageType = string;
1914
1909
  export declare const PageTypeDoc: PageType;
1915
1910
  export declare const PageTypeBlog: PageType;
1916
1911
  export declare const PageTypePage: PageType;
1917
- export interface PageDTO extends BaseModel, PermissionModelDTO {
1912
+ export interface PageDTO extends BaseModelDTO, PermissionModelDTO {
1918
1913
  is_featured: boolean;
1919
1914
  title: string;
1920
1915
  content: string;
@@ -1939,7 +1934,7 @@ export interface MenuItem {
1939
1934
  expanded?: boolean;
1940
1935
  children?: MenuItem[];
1941
1936
  }
1942
- export interface MenuDTO extends BaseModel, PermissionModelDTO {
1937
+ export interface MenuDTO extends BaseModelDTO, PermissionModelDTO {
1943
1938
  name: string;
1944
1939
  slug: string;
1945
1940
  description: string;
@@ -1983,7 +1978,7 @@ export interface Project extends BaseModel, PermissionModel {
1983
1978
  /**
1984
1979
  * ProjectDTO for API responses
1985
1980
  */
1986
- export interface ProjectDTO extends BaseModel, PermissionModelDTO {
1981
+ export interface ProjectDTO extends BaseModelDTO, PermissionModelDTO {
1987
1982
  name: string;
1988
1983
  description: string;
1989
1984
  type: ProjectType;
@@ -2048,14 +2043,6 @@ export interface SetupAction {
2048
2043
  provider?: string;
2049
2044
  scopes?: string[];
2050
2045
  }
2051
- /**
2052
- * SecretRef tracks which Secret record provided a value for a task (for billing)
2053
- */
2054
- export interface SecretRef {
2055
- key: string;
2056
- id: string;
2057
- team_id: string;
2058
- }
2059
2046
  export type InstanceCloudProvider = string;
2060
2047
  export declare const CloudAWS: InstanceCloudProvider;
2061
2048
  export declare const CloudAzure: InstanceCloudProvider;
@@ -2295,73 +2282,6 @@ export interface TaskAction {
2295
2282
  export interface TaskMetadata {
2296
2283
  action?: TaskAction;
2297
2284
  }
2298
- export interface Task extends BaseModel, PermissionModel {
2299
- is_featured: boolean;
2300
- status: TaskStatus;
2301
- /**
2302
- * Foreign keys
2303
- */
2304
- app_id: string;
2305
- app?: App;
2306
- version_id: string;
2307
- app_version?: AppVersion;
2308
- /**
2309
- * Deprecated: Will be removed in favor of Setup
2310
- */
2311
- variant: string;
2312
- /**
2313
- * Function is the specific function to call on multi-function apps.
2314
- * DEPRECATED: Standardizing on explicit function name.
2315
- * Defaults to "run" for legacy tasks (backfilled via migration).
2316
- */
2317
- function: string;
2318
- infra: Infra;
2319
- workers: string[];
2320
- engine_id?: string;
2321
- engine?: EngineState;
2322
- worker_id?: string;
2323
- worker?: WorkerState;
2324
- /**
2325
- * Belongs to:
2326
- */
2327
- flow_run_id?: string;
2328
- chat_id?: string;
2329
- /**
2330
- * Owns: (Can be replaced with graph execution edge/node)
2331
- */
2332
- sub_flow_run_id?: string;
2333
- webhook?: string;
2334
- metadata?: TaskMetadata;
2335
- setup?: any;
2336
- input: any;
2337
- output: any;
2338
- error?: string;
2339
- rating: ContentRating;
2340
- /**
2341
- * Relationships
2342
- */
2343
- events: TaskEvent[];
2344
- logs: TaskLog[];
2345
- usage_events: (UsageEvent | undefined)[];
2346
- /**
2347
- * Secret refs for billing (tracks ownership to determine partner fee)
2348
- */
2349
- secrets?: SecretRef[];
2350
- /**
2351
- * App session reference (for session calls)
2352
- * Special value "new" means scheduler should create session when dispatching.
2353
- */
2354
- session_id?: string;
2355
- session?: AppSession;
2356
- /**
2357
- * Session timeout in seconds (only used when session="new")
2358
- */
2359
- session_timeout?: number;
2360
- /**
2361
- * Scheduled execution time (UTC). Scheduler skips task until this time.
2362
- */
2363
- run_at?: string;
2364
- }
2365
2285
  export interface TaskEvent {
2366
2286
  id: string;
2367
2287
  created_at: string;
@@ -2383,7 +2303,7 @@ export interface TaskLog {
2383
2303
  log_type: TaskLogType;
2384
2304
  content: string;
2385
2305
  }
2386
- export interface TaskDTO extends BaseModel, PermissionModelDTO {
2306
+ export interface TaskDTO extends BaseModelDTO, PermissionModelDTO {
2387
2307
  graph_id?: string;
2388
2308
  user_public_key: string;
2389
2309
  engine_public_key: string;
@@ -2445,7 +2365,7 @@ export interface Team extends BaseModel {
2445
2365
  max_concurrency: number;
2446
2366
  status: TeamStatus;
2447
2367
  }
2448
- export interface TeamDTO extends BaseModel {
2368
+ export interface TeamDTO extends BaseModelDTO {
2449
2369
  type: TeamType;
2450
2370
  name: string;
2451
2371
  username: string;
@@ -2492,7 +2412,7 @@ export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
2492
2412
  /**
2493
2413
  * ToolInvocationDTO for API responses
2494
2414
  */
2495
- export interface ToolInvocationDTO extends BaseModel, PermissionModelDTO {
2415
+ export interface ToolInvocationDTO extends BaseModelDTO, PermissionModelDTO {
2496
2416
  chat_message_id: string;
2497
2417
  tool_invocation_id: string;
2498
2418
  type: ToolType;
@@ -2569,7 +2489,7 @@ export declare const RoleGuest: Role;
2569
2489
  export declare const RoleUser: Role;
2570
2490
  export declare const RoleAdmin: Role;
2571
2491
  export declare const RoleSystem: Role;
2572
- export interface UserDTO extends BaseModel {
2492
+ export interface UserDTO extends BaseModelDTO {
2573
2493
  default_team_id: string;
2574
2494
  role: Role;
2575
2495
  email: string;
package/dist/types.js CHANGED
@@ -3,7 +3,7 @@ export const ToolTypeApp = "app"; // App tools - creates a Task
3
3
  export const ToolTypeAgent = "agent"; // Sub-agent tools - creates a sub-Chat
4
4
  export const ToolTypeHook = "hook"; // Webhook tools - HTTP POST to external URL (legacy)
5
5
  export const ToolTypeHTTP = "http"; // HTTP tools - authenticated HTTP request/response
6
- export const ToolTypeCall = "call"; // Call tools - alias for HTTP (preferred name)
6
+ export const ToolTypeCall = "call"; // Call tools - authenticated HTTP request/response (preferred over "http")
7
7
  export const ToolTypeMCP = "mcp"; // MCP tools - calls remote MCP server
8
8
  export const ToolTypeClient = "client"; // Client tools - executed by frontend
9
9
  export const ToolTypeInternal = "internal"; // Internal/built-in tools (plan, memory, widget, finish)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Official JavaScript/TypeScript SDK for inference.sh - Run AI models with a simple API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",