@inferencesh/sdk 0.6.14 → 0.6.19
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 +1 -1
- package/dist/agent/actions.js +10 -0
- package/dist/agent/provider.d.ts +2 -1
- package/dist/agent/provider.js +5 -5
- package/dist/agent/types.d.ts +3 -0
- package/dist/api/apps.d.ts +4 -0
- package/dist/api/apps.js +6 -0
- package/dist/api/index.d.ts +3 -3
- package/dist/http/index.d.ts +3 -3
- package/dist/index.d.ts +9 -9
- package/dist/types.d.ts +131 -19
- package/dist/types.js +26 -9
- package/package.json +8 -5
- package/dist/agent/actions.test.d.ts +0 -1
- package/dist/agent/actions.test.js +0 -820
- package/dist/agent/api.test.d.ts +0 -1
- package/dist/agent/api.test.js +0 -246
- package/dist/agent/reducer.test.d.ts +0 -1
- package/dist/agent/reducer.test.js +0 -131
- package/dist/agent/types.test.d.ts +0 -1
- package/dist/agent/types.test.js +0 -75
- package/dist/api/agents.test.d.ts +0 -1
- package/dist/api/agents.test.js +0 -1014
- package/dist/api/api-keys.test.d.ts +0 -1
- package/dist/api/api-keys.test.js +0 -44
- package/dist/api/apps.test.d.ts +0 -1
- package/dist/api/apps.test.js +0 -135
- package/dist/api/chats.test.d.ts +0 -1
- package/dist/api/chats.test.js +0 -85
- package/dist/api/engines.test.d.ts +0 -1
- package/dist/api/engines.test.js +0 -133
- package/dist/api/files.test.d.ts +0 -1
- package/dist/api/files.test.js +0 -256
- package/dist/api/flow-runs.test.d.ts +0 -1
- package/dist/api/flow-runs.test.js +0 -97
- package/dist/api/flows.test.d.ts +0 -1
- package/dist/api/flows.test.js +0 -118
- package/dist/api/integrations.test.d.ts +0 -1
- package/dist/api/integrations.test.js +0 -109
- package/dist/api/knowledge.test.d.ts +0 -1
- package/dist/api/knowledge.test.js +0 -238
- package/dist/api/mcp-servers.test.d.ts +0 -1
- package/dist/api/mcp-servers.test.js +0 -98
- package/dist/api/projects.test.d.ts +0 -1
- package/dist/api/projects.test.js +0 -61
- package/dist/api/search.test.d.ts +0 -1
- package/dist/api/search.test.js +0 -50
- package/dist/api/secrets.test.d.ts +0 -1
- package/dist/api/secrets.test.js +0 -61
- package/dist/api/sessions.test.d.ts +0 -1
- package/dist/api/sessions.test.js +0 -61
- package/dist/api/tasks.test.d.ts +0 -1
- package/dist/api/tasks.test.js +0 -381
- package/dist/api/teams.test.d.ts +0 -1
- package/dist/api/teams.test.js +0 -139
- package/dist/client.test.d.ts +0 -1
- package/dist/client.test.js +0 -446
- package/dist/http/client.test.d.ts +0 -1
- package/dist/http/client.test.js +0 -435
- package/dist/http/errors.test.d.ts +0 -1
- package/dist/http/errors.test.js +0 -66
- package/dist/http/poll.test.d.ts +0 -1
- package/dist/http/poll.test.js +0 -146
- package/dist/http/streamable.test.d.ts +0 -4
- package/dist/http/streamable.test.js +0 -510
- package/dist/integration.test.d.ts +0 -9
- package/dist/integration.test.js +0 -107
- package/dist/proxy/express.test.d.ts +0 -1
- package/dist/proxy/express.test.js +0 -106
- package/dist/proxy/hono.test.d.ts +0 -1
- package/dist/proxy/hono.test.js +0 -90
- package/dist/proxy/index.test.d.ts +0 -1
- package/dist/proxy/index.test.js +0 -173
- package/dist/proxy/nextjs.test.d.ts +0 -1
- package/dist/proxy/nextjs.test.js +0 -125
- package/dist/proxy/remix.test.d.ts +0 -1
- package/dist/proxy/remix.test.js +0 -66
- package/dist/proxy/svelte.test.d.ts +0 -1
- package/dist/proxy/svelte.test.js +0 -69
- package/dist/sessions.integration.test.d.ts +0 -13
- package/dist/sessions.integration.test.js +0 -310
- package/dist/stream.test.d.ts +0 -1
- package/dist/stream.test.js +0 -363
- package/dist/streamable.integration.test.d.ts +0 -11
- package/dist/streamable.integration.test.js +0 -150
- package/dist/tool-builder.test.d.ts +0 -1
- package/dist/tool-builder.test.js +0 -407
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -43
package/README.md
CHANGED
|
@@ -677,7 +677,7 @@ import type {
|
|
|
677
677
|
|
|
678
678
|
- [documentation](https://inference.sh/docs) — getting started guides and api reference
|
|
679
679
|
- [blog](https://inference.sh/blog) — tutorials on ai agents, image generation, and more
|
|
680
|
-
- [app store](https://app.inference.sh) — browse
|
|
680
|
+
- [app store](https://app.inference.sh) — browse ai models
|
|
681
681
|
- [discord](https://discord.gg/inference) — community support
|
|
682
682
|
- [github](https://github.com/inference-sh) — open source projects
|
|
683
683
|
|
package/dist/agent/actions.js
CHANGED
|
@@ -18,6 +18,14 @@ const dispatchedToolInvocations = new Set();
|
|
|
18
18
|
// =============================================================================
|
|
19
19
|
export function createActions(ctx) {
|
|
20
20
|
const { client, dispatch, getConfig, getChatId, getClientToolHandlers, getStreamManager, setStreamManager, getStreamEnabled, getPollIntervalMs, callbacks } = ctx;
|
|
21
|
+
let prevChatWasBusy = false;
|
|
22
|
+
const checkTurnEnd = (chat) => {
|
|
23
|
+
const isBusy = chat.status === ChatStatusBusy;
|
|
24
|
+
if (prevChatWasBusy && !isBusy) {
|
|
25
|
+
callbacks.onTurnEnd?.(chat);
|
|
26
|
+
}
|
|
27
|
+
prevChatWasBusy = isBusy;
|
|
28
|
+
};
|
|
21
29
|
// =========================================================================
|
|
22
30
|
// Internal helpers
|
|
23
31
|
// =========================================================================
|
|
@@ -26,6 +34,7 @@ export function createActions(ctx) {
|
|
|
26
34
|
if (chat) {
|
|
27
35
|
const status = chat.status === ChatStatusBusy ? 'streaming' : 'idle';
|
|
28
36
|
callbacks.onStatusChange?.(status);
|
|
37
|
+
checkTurnEnd(chat);
|
|
29
38
|
}
|
|
30
39
|
};
|
|
31
40
|
const updateMessage = (message) => {
|
|
@@ -129,6 +138,7 @@ export function createActions(ctx) {
|
|
|
129
138
|
if (chatData) {
|
|
130
139
|
const status = chatData.status === ChatStatusBusy ? 'streaming' : 'idle';
|
|
131
140
|
callbacks.onStatusChange?.(status);
|
|
141
|
+
checkTurnEnd(chatData);
|
|
132
142
|
}
|
|
133
143
|
});
|
|
134
144
|
// Listen for ChatMessage updates
|
package/dist/agent/provider.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* React provider for agent chat state management.
|
|
5
5
|
* Uses React useReducer + Context pattern.
|
|
6
6
|
*/
|
|
7
|
+
import React from 'react';
|
|
7
8
|
import type { AgentChatProviderProps } from './types';
|
|
8
9
|
/**
|
|
9
10
|
* AgentChatProvider - Provides chat state and actions to children
|
|
@@ -27,7 +28,7 @@ import type { AgentChatProviderProps } from './types';
|
|
|
27
28
|
* }
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
|
-
export declare function AgentChatProvider({ client, agentConfig, chatId, clientToolHandlers: extraHandlers, onChatCreated, onStatusChange, onError, stream, pollIntervalMs, children, }: AgentChatProviderProps):
|
|
31
|
+
export declare function AgentChatProvider({ client, agentConfig, chatId, clientToolHandlers: extraHandlers, onChatCreated, onStatusChange, onError, onTurnEnd, stream, pollIntervalMs, children, }: AgentChatProviderProps): React.JSX.Element;
|
|
31
32
|
export declare namespace AgentChatProvider {
|
|
32
33
|
var displayName: string;
|
|
33
34
|
}
|
package/dist/agent/provider.js
CHANGED
|
@@ -39,7 +39,7 @@ function mergeHandlers(base, extra) {
|
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
export function AgentChatProvider({ client, agentConfig, chatId, clientToolHandlers: extraHandlers, onChatCreated, onStatusChange, onError, stream, pollIntervalMs, children, }) {
|
|
42
|
+
export function AgentChatProvider({ client, agentConfig, chatId, clientToolHandlers: extraHandlers, onChatCreated, onStatusChange, onError, onTurnEnd, stream, pollIntervalMs, children, }) {
|
|
43
43
|
// Core state via useReducer
|
|
44
44
|
const [state, dispatch] = useReducer(chatReducer, initialState);
|
|
45
45
|
// Refs for mutable values that actions need access to
|
|
@@ -49,15 +49,15 @@ export function AgentChatProvider({ client, agentConfig, chatId, clientToolHandl
|
|
|
49
49
|
const streamRef = useRef(stream);
|
|
50
50
|
const pollIntervalMsRef = useRef(pollIntervalMs);
|
|
51
51
|
const clientToolHandlersRef = useRef(mergeHandlers(getClientToolHandlers(agentConfig), extraHandlers));
|
|
52
|
-
const callbacksRef = useRef({ onChatCreated, onStatusChange, onError });
|
|
52
|
+
const callbacksRef = useRef({ onChatCreated, onStatusChange, onError, onTurnEnd });
|
|
53
53
|
// Keep refs in sync with props
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
configRef.current = agentConfig;
|
|
56
56
|
clientToolHandlersRef.current = mergeHandlers(getClientToolHandlers(agentConfig), extraHandlers);
|
|
57
57
|
}, [agentConfig, extraHandlers]);
|
|
58
58
|
useEffect(() => {
|
|
59
|
-
callbacksRef.current = { onChatCreated, onStatusChange, onError };
|
|
60
|
-
}, [onChatCreated, onStatusChange, onError]);
|
|
59
|
+
callbacksRef.current = { onChatCreated, onStatusChange, onError, onTurnEnd };
|
|
60
|
+
}, [onChatCreated, onStatusChange, onError, onTurnEnd]);
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
streamRef.current = stream;
|
|
63
63
|
pollIntervalMsRef.current = pollIntervalMs;
|
|
@@ -82,7 +82,7 @@ export function AgentChatProvider({ client, agentConfig, chatId, clientToolHandl
|
|
|
82
82
|
// Re-bind callbacks when they change
|
|
83
83
|
useEffect(() => {
|
|
84
84
|
actionsContext.callbacks = callbacksRef.current;
|
|
85
|
-
}, [actionsContext, onChatCreated, onStatusChange, onError]);
|
|
85
|
+
}, [actionsContext, onChatCreated, onStatusChange, onError, onTurnEnd]);
|
|
86
86
|
const actionsResultRef = useRef(null);
|
|
87
87
|
if (!actionsResultRef.current) {
|
|
88
88
|
actionsResultRef.current = createActions(actionsContext);
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -135,6 +135,8 @@ export interface AgentChatProviderProps {
|
|
|
135
135
|
onStatusChange?: (status: ChatStatus) => void;
|
|
136
136
|
/** Callback when an error occurs */
|
|
137
137
|
onError?: (error: Error) => void;
|
|
138
|
+
/** Callback when the agent's turn ends (chat transitions from busy to idle/completed) */
|
|
139
|
+
onTurnEnd?: (chat: ChatDTO) => void;
|
|
138
140
|
/** Use SSE streaming (true, default) or polling (false) for real-time updates */
|
|
139
141
|
stream?: boolean;
|
|
140
142
|
/** Polling interval in ms when stream is false (default: 2000) */
|
|
@@ -216,6 +218,7 @@ export interface ActionsContext {
|
|
|
216
218
|
onChatCreated?: (chatId: string) => void;
|
|
217
219
|
onStatusChange?: (status: ChatStatus) => void;
|
|
218
220
|
onError?: (error: Error) => void;
|
|
221
|
+
onTurnEnd?: (chat: ChatDTO) => void;
|
|
219
222
|
};
|
|
220
223
|
}
|
|
221
224
|
/**
|
package/dist/api/apps.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ export declare class AppsAPI {
|
|
|
46
46
|
* Update app visibility
|
|
47
47
|
*/
|
|
48
48
|
updateVisibility(appId: string, visibility: string): Promise<App>;
|
|
49
|
+
/**
|
|
50
|
+
* Update app lifecycle status
|
|
51
|
+
*/
|
|
52
|
+
updateStatus(appId: string, status: string, message?: string): Promise<App>;
|
|
49
53
|
/**
|
|
50
54
|
* Get an app by namespace and name (e.g., "inference/claude-haiku")
|
|
51
55
|
*/
|
package/dist/api/apps.js
CHANGED
|
@@ -65,6 +65,12 @@ export class AppsAPI {
|
|
|
65
65
|
async updateVisibility(appId, visibility) {
|
|
66
66
|
return this.http.request('post', `/apps/${appId}/visibility`, { data: { visibility } });
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Update app lifecycle status
|
|
70
|
+
*/
|
|
71
|
+
async updateStatus(appId, status, message) {
|
|
72
|
+
return this.http.request('post', `/apps/${appId}/status`, { data: { status, message } });
|
|
73
|
+
}
|
|
68
74
|
/**
|
|
69
75
|
* Get an app by namespace and name (e.g., "inference/claude-haiku")
|
|
70
76
|
*/
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TasksAPI, createTasksAPI, RunOptions } from './tasks';
|
|
2
|
-
export { FilesAPI, createFilesAPI, UploadFileOptions } from './files';
|
|
3
|
-
export { AgentsAPI, createAgentsAPI, Agent, AgentOptions, SendMessageOptions, AgentRunOptions } from './agents';
|
|
1
|
+
export { TasksAPI, createTasksAPI, type RunOptions } from './tasks';
|
|
2
|
+
export { FilesAPI, createFilesAPI, type UploadFileOptions } from './files';
|
|
3
|
+
export { AgentsAPI, createAgentsAPI, Agent, type AgentOptions, type SendMessageOptions, type AgentRunOptions } from './agents';
|
|
4
4
|
export { SessionsAPI, createSessionsAPI } from './sessions';
|
package/dist/http/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { HttpClient, HttpClientConfig, ErrorHandler, createHttpClient } from './client';
|
|
2
|
-
export { StreamManager, StreamManagerOptions, PartialDataWrapper } from './stream';
|
|
3
|
-
export { streamable, streamableRaw, StreamableManager, StreamableOptions, StreamableMessage, StreamableManagerOptions } from './streamable';
|
|
1
|
+
export { HttpClient, type HttpClientConfig, type ErrorHandler, createHttpClient } from './client';
|
|
2
|
+
export { StreamManager, type StreamManagerOptions, type PartialDataWrapper } from './stream';
|
|
3
|
+
export { streamable, streamableRaw, StreamableManager, type StreamableOptions, type StreamableMessage, type StreamableManagerOptions } from './streamable';
|
|
4
4
|
export { InferenceError, RequirementsNotMetException } from './errors';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { HttpClient, HttpClientConfig, ErrorHandler, createHttpClient } from './http/client';
|
|
2
|
-
export { StreamManager, StreamManagerOptions, PartialDataWrapper } from './http/stream';
|
|
3
|
-
export { StreamableManager, StreamableManagerOptions, StreamableMessage, streamable, streamableRaw } from './http/streamable';
|
|
4
|
-
export { PollManager, PollManagerOptions } from './http/poll';
|
|
1
|
+
export { HttpClient, type HttpClientConfig, type ErrorHandler, createHttpClient } from './http/client';
|
|
2
|
+
export { StreamManager, type StreamManagerOptions, type PartialDataWrapper } from './http/stream';
|
|
3
|
+
export { StreamableManager, type StreamableManagerOptions, type StreamableMessage, streamable, streamableRaw } from './http/streamable';
|
|
4
|
+
export { PollManager, type PollManagerOptions } from './http/poll';
|
|
5
5
|
export { InferenceError, RequirementsNotMetException, SessionError, SessionNotFoundError, SessionExpiredError, SessionEndedError, WorkerLostError, isRequirementsNotMetException, isInferenceError, isSessionError, } from './http/errors';
|
|
6
|
-
export { TasksAPI, RunOptions } from './api/tasks';
|
|
7
|
-
export { FilesAPI, UploadFileOptions } from './api/files';
|
|
8
|
-
export { AgentsAPI, Agent, AgentOptions, SendMessageOptions, AgentRunOptions } from './api/agents';
|
|
6
|
+
export { TasksAPI, type RunOptions } from './api/tasks';
|
|
7
|
+
export { FilesAPI, type UploadFileOptions } from './api/files';
|
|
8
|
+
export { AgentsAPI, Agent, type AgentOptions, type SendMessageOptions, type AgentRunOptions } from './api/agents';
|
|
9
9
|
export { SessionsAPI } from './api/sessions';
|
|
10
10
|
export { AppsAPI } from './api/apps';
|
|
11
11
|
export { ChatsAPI } from './api/chats';
|
|
@@ -13,7 +13,7 @@ export { FlowsAPI } from './api/flows';
|
|
|
13
13
|
export { FlowRunsAPI } from './api/flow-runs';
|
|
14
14
|
export { EnginesAPI } from './api/engines';
|
|
15
15
|
export { KnowledgeAPI, SkillsAPI } from './api/knowledge';
|
|
16
|
-
export { TeamsAPI, MeResponse } from './api/teams';
|
|
16
|
+
export { TeamsAPI, type MeResponse } from './api/teams';
|
|
17
17
|
export { SecretsAPI } from './api/secrets';
|
|
18
18
|
export { ApiKeysAPI } from './api/api-keys';
|
|
19
19
|
export { IntegrationsAPI } from './api/integrations';
|
|
@@ -25,7 +25,7 @@ export type { ClientTool, ClientToolHandler } from './tool-builder';
|
|
|
25
25
|
export { parseStatus, isTerminalStatus } from './utils';
|
|
26
26
|
export * from './types';
|
|
27
27
|
export type { TaskDTO as Task } from './types';
|
|
28
|
-
import { HttpClient, HttpClientConfig } from './http/client';
|
|
28
|
+
import { HttpClient, type HttpClientConfig } from './http/client';
|
|
29
29
|
import { TasksAPI, RunOptions } from './api/tasks';
|
|
30
30
|
import { FilesAPI, UploadFileOptions } from './api/files';
|
|
31
31
|
import { AgentsAPI, Agent, AgentOptions } from './api/agents';
|
package/dist/types.d.ts
CHANGED
|
@@ -411,6 +411,8 @@ export interface AuthResponse {
|
|
|
411
411
|
*/
|
|
412
412
|
export interface DeviceAuthInitRequest {
|
|
413
413
|
token_kind?: DeviceTokenKind;
|
|
414
|
+
code_challenge?: string;
|
|
415
|
+
code_challenge_method?: string;
|
|
414
416
|
}
|
|
415
417
|
export interface DeviceAuthResponse {
|
|
416
418
|
user_code: string;
|
|
@@ -506,6 +508,46 @@ export interface CreateApiKeyRequest {
|
|
|
506
508
|
expires_at?: string;
|
|
507
509
|
scopes?: string[];
|
|
508
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* EstimateCostRequest is the request for POST /store/apps/{appId}/estimate.
|
|
513
|
+
*/
|
|
514
|
+
export interface EstimateCostRequest {
|
|
515
|
+
input: {
|
|
516
|
+
[key: string]: any;
|
|
517
|
+
};
|
|
518
|
+
function?: string;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* EstimateCostResponse is the response from the cost estimation endpoint.
|
|
522
|
+
*/
|
|
523
|
+
export interface EstimateCostResponse {
|
|
524
|
+
/**
|
|
525
|
+
* Confidence: "exact" (all fees input-based), "range" (estimate expression),
|
|
526
|
+
* or "unknown" (output-dependent, no estimate expression).
|
|
527
|
+
*/
|
|
528
|
+
confidence: string;
|
|
529
|
+
/**
|
|
530
|
+
* Microcents is set when confidence is "exact".
|
|
531
|
+
*/
|
|
532
|
+
microcents?: number;
|
|
533
|
+
/**
|
|
534
|
+
* Min/Max are set when confidence is "range".
|
|
535
|
+
*/
|
|
536
|
+
min?: number;
|
|
537
|
+
max?: number;
|
|
538
|
+
/**
|
|
539
|
+
* DependsOn lists post-execution variables the pricing needs (when not exact).
|
|
540
|
+
*/
|
|
541
|
+
depends_on?: string[];
|
|
542
|
+
/**
|
|
543
|
+
* EstimateError is set when an estimate expression exists but failed to evaluate.
|
|
544
|
+
*/
|
|
545
|
+
estimate_error?: string;
|
|
546
|
+
/**
|
|
547
|
+
* PricingDescription is the rendered human-readable pricing string.
|
|
548
|
+
*/
|
|
549
|
+
pricing_description?: string;
|
|
550
|
+
}
|
|
509
551
|
/**
|
|
510
552
|
* Scope represents an API key permission scope string.
|
|
511
553
|
*/
|
|
@@ -683,7 +725,7 @@ export declare const ScopeBillingRead: Scope;
|
|
|
683
725
|
*/
|
|
684
726
|
export declare const ScopeBillingWrite: Scope;
|
|
685
727
|
/**
|
|
686
|
-
* Action-level scopes for Secrets (sensitive -
|
|
728
|
+
* Action-level scopes for Secrets (sensitive - excluded from read-only preset)
|
|
687
729
|
*/
|
|
688
730
|
export declare const ScopeSecretsRead: Scope;
|
|
689
731
|
/**
|
|
@@ -794,6 +836,8 @@ export interface ScopePreset {
|
|
|
794
836
|
label: string;
|
|
795
837
|
description: string;
|
|
796
838
|
scopes: Scope[];
|
|
839
|
+
summary?: string[];
|
|
840
|
+
hidden?: boolean;
|
|
797
841
|
}
|
|
798
842
|
/**
|
|
799
843
|
* ApiKeyDTO for API responses
|
|
@@ -820,6 +864,19 @@ export interface AppPricing {
|
|
|
820
864
|
royalty_expression: string;
|
|
821
865
|
partner_expression: string;
|
|
822
866
|
total_expression: string;
|
|
867
|
+
/**
|
|
868
|
+
* Estimate is a single CEL expression for pre-execution cost estimation.
|
|
869
|
+
* Returns either an int (exact total in microcents) or a {"min": int, "max": int} map.
|
|
870
|
+
* Only has access to pre-execution variables: task_inputs, prices, fees, task_function.
|
|
871
|
+
* Used by the /estimate endpoint when the real expressions depend on post-execution data.
|
|
872
|
+
* Not needed when all fee expressions are already input-based (the system evaluates those directly).
|
|
873
|
+
*/
|
|
874
|
+
estimate?: string;
|
|
875
|
+
/**
|
|
876
|
+
* Estimable is computed at save time. True when all fee expressions can be
|
|
877
|
+
* evaluated from pre-execution data alone (task_inputs, prices, fees, task_function).
|
|
878
|
+
*/
|
|
879
|
+
estimable?: boolean;
|
|
823
880
|
description: string;
|
|
824
881
|
description_rendered?: string;
|
|
825
882
|
}
|
|
@@ -900,6 +957,9 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
900
957
|
images: AppImages;
|
|
901
958
|
version_id: string;
|
|
902
959
|
version?: AppVersionDTO;
|
|
960
|
+
status: AppStatus;
|
|
961
|
+
status_message?: string;
|
|
962
|
+
status_changed_at?: string;
|
|
903
963
|
}
|
|
904
964
|
/**
|
|
905
965
|
* AppVersionDTO is the API response for an app version.
|
|
@@ -971,6 +1031,7 @@ export interface AppStoreListingDTO {
|
|
|
971
1031
|
max_concurrency: number;
|
|
972
1032
|
max_concurrency_per_team: number;
|
|
973
1033
|
min_concurrency: number;
|
|
1034
|
+
required_feature?: string;
|
|
974
1035
|
tags?: string[];
|
|
975
1036
|
}
|
|
976
1037
|
/**
|
|
@@ -1170,6 +1231,7 @@ export interface EngineDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
1170
1231
|
name: string;
|
|
1171
1232
|
api_url: string;
|
|
1172
1233
|
status: EngineStatus;
|
|
1234
|
+
engine_version: string;
|
|
1173
1235
|
system_info?: SystemInfo;
|
|
1174
1236
|
workers: (WorkerDTO | undefined)[];
|
|
1175
1237
|
}
|
|
@@ -1264,6 +1326,20 @@ export interface EntitlementDTO extends BaseModelDTO {
|
|
|
1264
1326
|
source: EntitlementSource;
|
|
1265
1327
|
enforcement: EnforcementMode;
|
|
1266
1328
|
expires_at?: string;
|
|
1329
|
+
team_plan_id?: string;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* EntitlementErrorMeta is the structured metadata returned in entitlement error responses.
|
|
1333
|
+
*/
|
|
1334
|
+
export interface EntitlementErrorMeta {
|
|
1335
|
+
resource: EntitlementResource;
|
|
1336
|
+
resource_label?: string;
|
|
1337
|
+
limit?: number;
|
|
1338
|
+
current?: number;
|
|
1339
|
+
upgrade_available: boolean;
|
|
1340
|
+
addon_plan_id?: string;
|
|
1341
|
+
addon_plan_name?: string;
|
|
1342
|
+
addon_plan_price?: number;
|
|
1267
1343
|
}
|
|
1268
1344
|
/**
|
|
1269
1345
|
* FileMetadata holds probed media metadata cached on File records.
|
|
@@ -1550,6 +1626,8 @@ export interface SkillDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
1550
1626
|
repo_url?: string;
|
|
1551
1627
|
version_id: string;
|
|
1552
1628
|
version?: SkillVersionDTO;
|
|
1629
|
+
uses: number;
|
|
1630
|
+
installs: number;
|
|
1553
1631
|
}
|
|
1554
1632
|
export interface SkillVersionDTO extends BaseModelDTO {
|
|
1555
1633
|
skill_id: string;
|
|
@@ -1582,6 +1660,8 @@ export interface KnowledgeDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
1582
1660
|
lifecycle: KnowledgeLifecycle;
|
|
1583
1661
|
version_id: string;
|
|
1584
1662
|
version?: KnowledgeVersionDTO;
|
|
1663
|
+
uses: number;
|
|
1664
|
+
installs: number;
|
|
1585
1665
|
}
|
|
1586
1666
|
export interface KnowledgeVersionDTO extends BaseModelDTO {
|
|
1587
1667
|
knowledge_id: string;
|
|
@@ -1590,6 +1670,7 @@ export interface KnowledgeVersionDTO extends BaseModelDTO {
|
|
|
1590
1670
|
content_hash: string;
|
|
1591
1671
|
description: string;
|
|
1592
1672
|
tags: string[];
|
|
1673
|
+
scope?: string[];
|
|
1593
1674
|
metadata?: {
|
|
1594
1675
|
[key: string]: string;
|
|
1595
1676
|
};
|
|
@@ -1819,12 +1900,23 @@ export interface PlanDTO extends BaseModelDTO {
|
|
|
1819
1900
|
display_order: number;
|
|
1820
1901
|
active: boolean;
|
|
1821
1902
|
self_serve?: boolean;
|
|
1822
|
-
|
|
1823
|
-
price_yearly?: number;
|
|
1903
|
+
plan_type: PlanType;
|
|
1824
1904
|
credits_monthly: number;
|
|
1905
|
+
active_version?: PlanVersionDTO;
|
|
1906
|
+
required_plan_ids?: string[];
|
|
1907
|
+
required_plan_names?: string[];
|
|
1908
|
+
stackable: boolean;
|
|
1909
|
+
limits: PlanLimits;
|
|
1910
|
+
}
|
|
1911
|
+
export interface PlanVersionDTO extends BaseModelDTO {
|
|
1912
|
+
plan_id?: string;
|
|
1913
|
+
amount_monthly: number;
|
|
1914
|
+
amount_yearly: number;
|
|
1825
1915
|
provider_price_id_monthly?: string;
|
|
1826
1916
|
provider_price_id_yearly?: string;
|
|
1827
|
-
|
|
1917
|
+
credits_monthly: number;
|
|
1918
|
+
limits?: PlanLimits;
|
|
1919
|
+
active: boolean;
|
|
1828
1920
|
}
|
|
1829
1921
|
/**
|
|
1830
1922
|
* ProjectModelDTO provides optional project association for DTOs
|
|
@@ -1854,6 +1946,7 @@ export interface RefRouteDTO extends BaseModelDTO {
|
|
|
1854
1946
|
alias_ref: string;
|
|
1855
1947
|
target_ref: string;
|
|
1856
1948
|
primary: boolean;
|
|
1949
|
+
mode: RefRouteMode;
|
|
1857
1950
|
description: string;
|
|
1858
1951
|
enabled: boolean;
|
|
1859
1952
|
}
|
|
@@ -1879,6 +1972,7 @@ export interface KnowledgeVersionInput {
|
|
|
1879
1972
|
content?: KnowledgeFile;
|
|
1880
1973
|
files?: KnowledgeFile[];
|
|
1881
1974
|
tags?: string[];
|
|
1975
|
+
scope?: string[];
|
|
1882
1976
|
metadata?: {
|
|
1883
1977
|
[key: string]: string;
|
|
1884
1978
|
};
|
|
@@ -1987,6 +2081,7 @@ export interface SuggestRequest {
|
|
|
1987
2081
|
limit?: number;
|
|
1988
2082
|
category?: string;
|
|
1989
2083
|
agent?: boolean;
|
|
2084
|
+
scope?: string[];
|
|
1990
2085
|
}
|
|
1991
2086
|
/**
|
|
1992
2087
|
* SuggestResponse is the output of the suggest endpoint.
|
|
@@ -2000,6 +2095,7 @@ export interface SuggestResponse {
|
|
|
2000
2095
|
*/
|
|
2001
2096
|
export interface SuggestResult {
|
|
2002
2097
|
type: string;
|
|
2098
|
+
tag?: string;
|
|
2003
2099
|
name: string;
|
|
2004
2100
|
description: string;
|
|
2005
2101
|
command: string;
|
|
@@ -2085,7 +2181,6 @@ export interface SecretDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
2085
2181
|
*/
|
|
2086
2182
|
export interface SubscriptionDTO extends BaseModelDTO {
|
|
2087
2183
|
team_id: string;
|
|
2088
|
-
stripe_subscription_id?: string;
|
|
2089
2184
|
plan_id: string;
|
|
2090
2185
|
plan?: PlanDTO;
|
|
2091
2186
|
interval: SubscriptionInterval;
|
|
@@ -2598,6 +2693,11 @@ export declare const AppCategoryChat: AppCategory;
|
|
|
2598
2693
|
export declare const AppCategory3D: AppCategory;
|
|
2599
2694
|
export declare const AppCategoryOther: AppCategory;
|
|
2600
2695
|
export declare const AppCategoryFlow: AppCategory;
|
|
2696
|
+
export type AppStatus = string;
|
|
2697
|
+
export declare const AppStatusActive: AppStatus;
|
|
2698
|
+
export declare const AppStatusMaintenance: AppStatus;
|
|
2699
|
+
export declare const AppStatusDeprecated: AppStatus;
|
|
2700
|
+
export declare const AppStatusRetired: AppStatus;
|
|
2601
2701
|
export type GPUType = string;
|
|
2602
2702
|
export declare const GPUTypeAny: GPUType;
|
|
2603
2703
|
export declare const GPUTypeNone: GPUType;
|
|
@@ -2621,6 +2721,21 @@ export declare const SubscriptionStatusPaused: SubscriptionStatus;
|
|
|
2621
2721
|
export type SubscriptionInterval = string;
|
|
2622
2722
|
export declare const SubscriptionIntervalMonthly: SubscriptionInterval;
|
|
2623
2723
|
export declare const SubscriptionIntervalYearly: SubscriptionInterval;
|
|
2724
|
+
export type PlanType = string;
|
|
2725
|
+
export declare const PlanTypeBase: PlanType;
|
|
2726
|
+
export declare const PlanTypeAddon: PlanType;
|
|
2727
|
+
export type EntitlementSource = string;
|
|
2728
|
+
export declare const EntitlementSourceTier: EntitlementSource;
|
|
2729
|
+
export declare const EntitlementSourceOverride: EntitlementSource;
|
|
2730
|
+
export declare const EntitlementSourceWhitelist: EntitlementSource;
|
|
2731
|
+
export declare const EntitlementSourceTrial: EntitlementSource;
|
|
2732
|
+
export declare const EntitlementSourceAddon: EntitlementSource;
|
|
2733
|
+
export type EntitlementType = string;
|
|
2734
|
+
export declare const EntitlementTypeBoolean: EntitlementType;
|
|
2735
|
+
export declare const EntitlementTypeLimit: EntitlementType;
|
|
2736
|
+
export type EnforcementMode = string;
|
|
2737
|
+
export declare const EnforcementBlock: EnforcementMode;
|
|
2738
|
+
export declare const EnforcementWarn: EnforcementMode;
|
|
2624
2739
|
export type ChatStatus = string;
|
|
2625
2740
|
export declare const ChatStatusBusy: ChatStatus;
|
|
2626
2741
|
export declare const ChatStatusIdle: ChatStatus;
|
|
@@ -2872,6 +2987,9 @@ export declare const GraphEdgeTypeParent: GraphEdgeType;
|
|
|
2872
2987
|
export declare const GraphEdgeTypeAncestor: GraphEdgeType;
|
|
2873
2988
|
export declare const GraphEdgeTypeDuplicate: GraphEdgeType;
|
|
2874
2989
|
export declare const GraphEdgeTypeReferences: GraphEdgeType;
|
|
2990
|
+
export declare const GraphEdgeTypeSupersedes: GraphEdgeType;
|
|
2991
|
+
export declare const GraphEdgeTypeInput: GraphEdgeType;
|
|
2992
|
+
export declare const GraphEdgeTypeOutput: GraphEdgeType;
|
|
2875
2993
|
/**
|
|
2876
2994
|
* SecretScope defines the visibility/purpose of a secret
|
|
2877
2995
|
*/
|
|
@@ -2888,20 +3006,6 @@ export declare const SecretScopeInternal: SecretScope;
|
|
|
2888
3006
|
* SecretScopeSystem is a global system setting, owned by system team, admin-only
|
|
2889
3007
|
*/
|
|
2890
3008
|
export declare const SecretScopeSystem: SecretScope;
|
|
2891
|
-
export type EntitlementSource = string;
|
|
2892
|
-
export declare const EntitlementSourceTier: EntitlementSource;
|
|
2893
|
-
export declare const EntitlementSourceOverride: EntitlementSource;
|
|
2894
|
-
export declare const EntitlementSourceWhitelist: EntitlementSource;
|
|
2895
|
-
export declare const EntitlementSourceTrial: EntitlementSource;
|
|
2896
|
-
export type EntitlementType = string;
|
|
2897
|
-
export declare const EntitlementTypeBoolean: EntitlementType;
|
|
2898
|
-
export declare const EntitlementTypeLimit: EntitlementType;
|
|
2899
|
-
/**
|
|
2900
|
-
* EnforcementMode controls how limit violations are handled.
|
|
2901
|
-
*/
|
|
2902
|
-
export type EnforcementMode = string;
|
|
2903
|
-
export declare const EnforcementBlock: EnforcementMode;
|
|
2904
|
-
export declare const EnforcementWarn: EnforcementMode;
|
|
2905
3009
|
export type PageStatus = number;
|
|
2906
3010
|
export declare const PageStatusUnknown: PageStatus;
|
|
2907
3011
|
export declare const PageStatusDraft: PageStatus;
|
|
@@ -3030,6 +3134,9 @@ export type RefRouteType = string;
|
|
|
3030
3134
|
export declare const RefRouteTypeApp: RefRouteType;
|
|
3031
3135
|
export declare const RefRouteTypeAgent: RefRouteType;
|
|
3032
3136
|
export declare const RefRouteTypeSkill: RefRouteType;
|
|
3137
|
+
export type RefRouteMode = string;
|
|
3138
|
+
export declare const RefRouteModeRewrite: RefRouteMode;
|
|
3139
|
+
export declare const RefRouteModeRedirect: RefRouteMode;
|
|
3033
3140
|
export type KnowledgeType = string;
|
|
3034
3141
|
export declare const KnowledgeTypeConcept: KnowledgeType;
|
|
3035
3142
|
export declare const KnowledgeTypeSkill: KnowledgeType;
|
|
@@ -3103,6 +3210,7 @@ export declare const ResourceTaskExecutions: EntitlementResource;
|
|
|
3103
3210
|
* Feature gates — only what has real cost/complexity
|
|
3104
3211
|
*/
|
|
3105
3212
|
export declare const ResourceFeatureBYOK: EntitlementResource;
|
|
3213
|
+
export declare const ResourceFeatureSeedance: EntitlementResource;
|
|
3106
3214
|
/**
|
|
3107
3215
|
* Legacy feature gates — kept for DB compatibility, no longer gated
|
|
3108
3216
|
*/
|
|
@@ -3243,6 +3351,10 @@ export declare const NotificationTypeSecurityAlert: NotificationType;
|
|
|
3243
3351
|
*/
|
|
3244
3352
|
export declare const NotificationTypeTaskComplete: NotificationType;
|
|
3245
3353
|
export declare const NotificationTypeTaskFailed: NotificationType;
|
|
3354
|
+
/**
|
|
3355
|
+
* Data export
|
|
3356
|
+
*/
|
|
3357
|
+
export declare const NotificationTypeDataExport: NotificationType;
|
|
3246
3358
|
/**
|
|
3247
3359
|
* System notifications
|
|
3248
3360
|
*/
|
package/dist/types.js
CHANGED
|
@@ -172,7 +172,7 @@ export const ScopeBillingRead = "billing:read";
|
|
|
172
172
|
*/
|
|
173
173
|
export const ScopeBillingWrite = "billing:write";
|
|
174
174
|
/**
|
|
175
|
-
* Action-level scopes for Secrets (sensitive -
|
|
175
|
+
* Action-level scopes for Secrets (sensitive - excluded from read-only preset)
|
|
176
176
|
*/
|
|
177
177
|
export const ScopeSecretsRead = "secrets:read";
|
|
178
178
|
/**
|
|
@@ -269,6 +269,10 @@ export const AppCategoryChat = "chat";
|
|
|
269
269
|
export const AppCategory3D = "3d";
|
|
270
270
|
export const AppCategoryOther = "other";
|
|
271
271
|
export const AppCategoryFlow = "flow";
|
|
272
|
+
export const AppStatusActive = "active";
|
|
273
|
+
export const AppStatusMaintenance = "maintenance";
|
|
274
|
+
export const AppStatusDeprecated = "deprecated";
|
|
275
|
+
export const AppStatusRetired = "retired";
|
|
272
276
|
export const GPUTypeAny = "any";
|
|
273
277
|
export const GPUTypeNone = "none";
|
|
274
278
|
export const GPUTypeIntel = "intel";
|
|
@@ -285,6 +289,17 @@ export const SubscriptionStatusCanceled = "canceled";
|
|
|
285
289
|
export const SubscriptionStatusPaused = "paused";
|
|
286
290
|
export const SubscriptionIntervalMonthly = "monthly";
|
|
287
291
|
export const SubscriptionIntervalYearly = "yearly";
|
|
292
|
+
export const PlanTypeBase = "base";
|
|
293
|
+
export const PlanTypeAddon = "addon";
|
|
294
|
+
export const EntitlementSourceTier = "tier";
|
|
295
|
+
export const EntitlementSourceOverride = "override";
|
|
296
|
+
export const EntitlementSourceWhitelist = "whitelist";
|
|
297
|
+
export const EntitlementSourceTrial = "trial";
|
|
298
|
+
export const EntitlementSourceAddon = "addon";
|
|
299
|
+
export const EntitlementTypeBoolean = "boolean";
|
|
300
|
+
export const EntitlementTypeLimit = "limit";
|
|
301
|
+
export const EnforcementBlock = "block";
|
|
302
|
+
export const EnforcementWarn = "warn";
|
|
288
303
|
export const ChatStatusBusy = "busy";
|
|
289
304
|
export const ChatStatusIdle = "idle";
|
|
290
305
|
export const ChatStatusAwaitingInput = "awaiting_input";
|
|
@@ -355,6 +370,9 @@ export const GraphEdgeTypeParent = "parent";
|
|
|
355
370
|
export const GraphEdgeTypeAncestor = "ancestor";
|
|
356
371
|
export const GraphEdgeTypeDuplicate = "duplicate";
|
|
357
372
|
export const GraphEdgeTypeReferences = "references";
|
|
373
|
+
export const GraphEdgeTypeSupersedes = "supersedes";
|
|
374
|
+
export const GraphEdgeTypeInput = "input";
|
|
375
|
+
export const GraphEdgeTypeOutput = "output";
|
|
358
376
|
/**
|
|
359
377
|
* SecretScopeTeam is a normal user secret, visible in team secret lists
|
|
360
378
|
*/
|
|
@@ -367,14 +385,6 @@ export const SecretScopeInternal = "internal";
|
|
|
367
385
|
* SecretScopeSystem is a global system setting, owned by system team, admin-only
|
|
368
386
|
*/
|
|
369
387
|
export const SecretScopeSystem = "system";
|
|
370
|
-
export const EntitlementSourceTier = "tier";
|
|
371
|
-
export const EntitlementSourceOverride = "override";
|
|
372
|
-
export const EntitlementSourceWhitelist = "whitelist";
|
|
373
|
-
export const EntitlementSourceTrial = "trial";
|
|
374
|
-
export const EntitlementTypeBoolean = "boolean";
|
|
375
|
-
export const EntitlementTypeLimit = "limit";
|
|
376
|
-
export const EnforcementBlock = "block";
|
|
377
|
-
export const EnforcementWarn = "warn";
|
|
378
388
|
export const PageStatusUnknown = 0;
|
|
379
389
|
export const PageStatusDraft = 1;
|
|
380
390
|
export const PageStatusPublished = 2;
|
|
@@ -464,6 +474,8 @@ export const TeamInviteStatusRevoked = "revoked";
|
|
|
464
474
|
export const RefRouteTypeApp = "app";
|
|
465
475
|
export const RefRouteTypeAgent = "agent";
|
|
466
476
|
export const RefRouteTypeSkill = "skill";
|
|
477
|
+
export const RefRouteModeRewrite = "rewrite";
|
|
478
|
+
export const RefRouteModeRedirect = "redirect";
|
|
467
479
|
export const KnowledgeTypeConcept = "concept";
|
|
468
480
|
export const KnowledgeTypeSkill = "skill";
|
|
469
481
|
export const KnowledgeTypeObservation = "observation";
|
|
@@ -528,6 +540,7 @@ export const ResourceTaskExecutions = "task_executions";
|
|
|
528
540
|
* Feature gates — only what has real cost/complexity
|
|
529
541
|
*/
|
|
530
542
|
export const ResourceFeatureBYOK = "feature:byok";
|
|
543
|
+
export const ResourceFeatureSeedance = "feature:seedance";
|
|
531
544
|
/**
|
|
532
545
|
* Legacy feature gates — kept for DB compatibility, no longer gated
|
|
533
546
|
*/
|
|
@@ -638,6 +651,10 @@ export const NotificationTypeSecurityAlert = "security_alert";
|
|
|
638
651
|
*/
|
|
639
652
|
export const NotificationTypeTaskComplete = "task_complete";
|
|
640
653
|
export const NotificationTypeTaskFailed = "task_failed";
|
|
654
|
+
/**
|
|
655
|
+
* Data export
|
|
656
|
+
*/
|
|
657
|
+
export const NotificationTypeDataExport = "data_export";
|
|
641
658
|
/**
|
|
642
659
|
* System notifications
|
|
643
660
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inferencesh/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
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",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
+
"inference-src": "./src/index.ts",
|
|
11
12
|
"default": "./dist/index.js"
|
|
12
13
|
},
|
|
13
14
|
"./proxy": {
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"./agent": {
|
|
38
39
|
"types": "./dist/agent/index.d.ts",
|
|
40
|
+
"inference-src": "./src/agent/index.ts",
|
|
39
41
|
"default": "./dist/agent/index.js"
|
|
40
42
|
}
|
|
41
43
|
},
|
|
@@ -90,10 +92,10 @@
|
|
|
90
92
|
"svelte": "^5.55.7",
|
|
91
93
|
"@types/express": "^5.0.0",
|
|
92
94
|
"@types/jest": "^30.0.0",
|
|
93
|
-
"@types/node": "^
|
|
95
|
+
"@types/node": "^26.1.1",
|
|
94
96
|
"@types/react": "^19.1.12",
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
96
|
-
"@typescript-eslint/parser": "^8.
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
98
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
97
99
|
"eslint": "^9.32.0",
|
|
98
100
|
"eslint-config-prettier": "^10.1.8",
|
|
99
101
|
"hono": "^4.0.0",
|
|
@@ -103,7 +105,7 @@
|
|
|
103
105
|
"react": "^19.2.3",
|
|
104
106
|
"rimraf": "^6.0.1",
|
|
105
107
|
"ts-jest": "^29.2.5",
|
|
106
|
-
"typescript": "
|
|
108
|
+
"typescript": "~6.0.3"
|
|
107
109
|
},
|
|
108
110
|
"peerDependencies": {
|
|
109
111
|
"@sveltejs/kit": ">=2.0.0",
|
|
@@ -131,6 +133,7 @@
|
|
|
131
133
|
},
|
|
132
134
|
"files": [
|
|
133
135
|
"dist",
|
|
136
|
+
"!dist/**/*.test.*",
|
|
134
137
|
"README.md",
|
|
135
138
|
"LICENSE",
|
|
136
139
|
"CHANGELOG.md"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|