@inferencesh/sdk 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/live/session.js +2 -0
- package/dist/types.d.ts +53 -5
- package/dist/types.js +7 -0
- package/package.json +6 -6
package/dist/live/session.js
CHANGED
|
@@ -95,12 +95,14 @@ export class LiveSession {
|
|
|
95
95
|
const { onClear, onError } = this.handlers;
|
|
96
96
|
if (onClear && typeof record[CLEAR_KEY] === 'string') {
|
|
97
97
|
onClear(record[CLEAR_KEY]);
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
98
99
|
delete record[CLEAR_KEY];
|
|
99
100
|
}
|
|
100
101
|
if (onError) {
|
|
101
102
|
const key = ERROR_KEY in record ? ERROR_KEY : this.legacyError(record) ? 'error' : undefined;
|
|
102
103
|
if (key) {
|
|
103
104
|
const err = record[key];
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
104
106
|
delete record[key];
|
|
105
107
|
const { field = null, message } = (err && typeof err === 'object' ? err : { message: String(err) });
|
|
106
108
|
onError(field, typeof message === 'string' ? message : JSON.stringify(err));
|
package/dist/types.d.ts
CHANGED
|
@@ -216,6 +216,12 @@ export interface AgentDTO extends BaseModelDTO, PermissionModelDTO, ProjectModel
|
|
|
216
216
|
images: AgentImages;
|
|
217
217
|
version_id: string;
|
|
218
218
|
version?: AgentVersionDTO;
|
|
219
|
+
/**
|
|
220
|
+
* Harness is what drives the agent: "inference" for our own loop, or an
|
|
221
|
+
* agentprotocol registry id (claude, codex, ...) for an external harness,
|
|
222
|
+
* whose instructions, tools and versions are its own.
|
|
223
|
+
*/
|
|
224
|
+
harness: string;
|
|
219
225
|
/**
|
|
220
226
|
* ProfileID is set when a harness profile on a remote thinks for this
|
|
221
227
|
* agent instead of our loop.
|
|
@@ -579,12 +585,21 @@ export interface CredentialConnectRequest {
|
|
|
579
585
|
*/
|
|
580
586
|
connection_scope?: CredentialScope;
|
|
581
587
|
}
|
|
588
|
+
/**
|
|
589
|
+
* CredentialCompleteOAuthRequest is what the provider's redirect delivered:
|
|
590
|
+
* the code and state, the PKCE verifier the client kept, and every other
|
|
591
|
+
* query param the callback carried (QuickBooks' realmId, Shopify's shop),
|
|
592
|
+
* which a scheme reads as {{callback.*}}.
|
|
593
|
+
*/
|
|
582
594
|
export interface CredentialCompleteOAuthRequest {
|
|
583
595
|
provider: string;
|
|
584
596
|
type: string;
|
|
585
597
|
code: string;
|
|
586
598
|
state: string;
|
|
587
599
|
code_verifier?: string;
|
|
600
|
+
params?: {
|
|
601
|
+
[key: string]: string;
|
|
602
|
+
};
|
|
588
603
|
}
|
|
589
604
|
export interface CredentialConnectResponse {
|
|
590
605
|
credential?: CredentialDTO;
|
|
@@ -1573,7 +1588,6 @@ export interface PermissionModelDTO {
|
|
|
1573
1588
|
user?: UserRelationDTO;
|
|
1574
1589
|
team_id: string;
|
|
1575
1590
|
team?: TeamRelationDTO;
|
|
1576
|
-
org_id?: string;
|
|
1577
1591
|
visibility: Visibility;
|
|
1578
1592
|
}
|
|
1579
1593
|
/**
|
|
@@ -1690,6 +1704,10 @@ export interface ChatDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
1690
1704
|
* thinks for this chat; `claude --resume <id>` opens it on that machine.
|
|
1691
1705
|
*/
|
|
1692
1706
|
harness_session_id?: string;
|
|
1707
|
+
/**
|
|
1708
|
+
* WorkDir is the folder a harness works in for this chat.
|
|
1709
|
+
*/
|
|
1710
|
+
work_dir?: string;
|
|
1693
1711
|
/**
|
|
1694
1712
|
* ForkedFromMessageID is the message this chat was branched at.
|
|
1695
1713
|
*/
|
|
@@ -1717,7 +1735,8 @@ export interface ChatMessageDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
1717
1735
|
export interface CredentialDTO extends BaseModelDTO, PermissionModelDTO {
|
|
1718
1736
|
provider: string;
|
|
1719
1737
|
type: CredentialType;
|
|
1720
|
-
grant
|
|
1738
|
+
grant: CredentialGrant;
|
|
1739
|
+
app_credential_id?: string;
|
|
1721
1740
|
scope: CredentialScope;
|
|
1722
1741
|
status: CredentialStatus;
|
|
1723
1742
|
display_name: string;
|
|
@@ -1750,7 +1769,19 @@ export interface CredentialConfigDTO {
|
|
|
1750
1769
|
allows_byok: boolean;
|
|
1751
1770
|
available: boolean;
|
|
1752
1771
|
has_managed: boolean;
|
|
1753
|
-
|
|
1772
|
+
/**
|
|
1773
|
+
* ConnectionScope is who a new connection belongs to by default: the
|
|
1774
|
+
* team, or each user (their own account).
|
|
1775
|
+
*/
|
|
1776
|
+
connection_scope: CredentialScope;
|
|
1777
|
+
/**
|
|
1778
|
+
* App is the OAuth app a login to this provider goes through (a
|
|
1779
|
+
* grant=credentials row): the workspace's own, its org's or the
|
|
1780
|
+
* platform's. Nil when the provider signs in through an app and none is
|
|
1781
|
+
* set up yet, or when it doesn't sign in through one. Credential is the
|
|
1782
|
+
* login itself.
|
|
1783
|
+
*/
|
|
1784
|
+
app?: CredentialDTO;
|
|
1754
1785
|
/**
|
|
1755
1786
|
* AuthSchemeID is set when the provider is one the team defined
|
|
1756
1787
|
* itself (models.AuthScheme), so the UI can offer edit and remove.
|
|
@@ -2731,7 +2762,6 @@ export interface MCPServerDTO {
|
|
|
2731
2762
|
user?: UserRelationDTO;
|
|
2732
2763
|
team_id: string;
|
|
2733
2764
|
team?: TeamRelationDTO;
|
|
2734
|
-
org_id?: string;
|
|
2735
2765
|
visibility: Visibility;
|
|
2736
2766
|
slug: string;
|
|
2737
2767
|
name: string;
|
|
@@ -3589,6 +3619,14 @@ export interface TeamMemberDTO {
|
|
|
3589
3619
|
team_id: string;
|
|
3590
3620
|
role: TeamRole;
|
|
3591
3621
|
user?: TeamMemberUserDTO;
|
|
3622
|
+
/**
|
|
3623
|
+
* AssignableRoles are the roles the caller may set this member to, the
|
|
3624
|
+
* current one included; Removable, whether the caller may remove them.
|
|
3625
|
+
* Set on GET /teams/{id}/members by the rules the member writes enforce;
|
|
3626
|
+
* absent means none.
|
|
3627
|
+
*/
|
|
3628
|
+
assignable_roles?: TeamRole[];
|
|
3629
|
+
removable?: boolean;
|
|
3592
3630
|
}
|
|
3593
3631
|
/**
|
|
3594
3632
|
* TeamMemberUserDTO is a lightweight user view within team membership.
|
|
@@ -4745,10 +4783,20 @@ export declare const CredentialScopeTeam: CredentialScope;
|
|
|
4745
4783
|
export declare const CredentialScopeUser: CredentialScope;
|
|
4746
4784
|
export declare const CredentialScopeAgent: CredentialScope;
|
|
4747
4785
|
/**
|
|
4748
|
-
* CredentialGrant
|
|
4786
|
+
* CredentialGrant is which layer a credential row is. OAuth has two: the
|
|
4787
|
+
* app (client id and secret, owned by the platform, an org or a team) and
|
|
4788
|
+
* the logins made through it (owned by a team or a user). Every other
|
|
4789
|
+
* credential type is a token row.
|
|
4749
4790
|
*/
|
|
4750
4791
|
export type CredentialGrant = string;
|
|
4792
|
+
/**
|
|
4793
|
+
* CredentialGrantCredentials: an OAuth app. Never a connection.
|
|
4794
|
+
*/
|
|
4751
4795
|
export declare const CredentialGrantCredentials: CredentialGrant;
|
|
4796
|
+
/**
|
|
4797
|
+
* CredentialGrantToken: a connection: an OAuth login, an API key, a
|
|
4798
|
+
* service account, an MCP authorization.
|
|
4799
|
+
*/
|
|
4752
4800
|
export declare const CredentialGrantToken: CredentialGrant;
|
|
4753
4801
|
/**
|
|
4754
4802
|
* NotificationChannel represents a delivery channel
|
package/dist/types.js
CHANGED
|
@@ -856,7 +856,14 @@ export const CredentialScopeOrg = "org";
|
|
|
856
856
|
export const CredentialScopeTeam = "team";
|
|
857
857
|
export const CredentialScopeUser = "user";
|
|
858
858
|
export const CredentialScopeAgent = "agent";
|
|
859
|
+
/**
|
|
860
|
+
* CredentialGrantCredentials: an OAuth app. Never a connection.
|
|
861
|
+
*/
|
|
859
862
|
export const CredentialGrantCredentials = "credentials";
|
|
863
|
+
/**
|
|
864
|
+
* CredentialGrantToken: a connection: an OAuth login, an API key, a
|
|
865
|
+
* service account, an MCP authorization.
|
|
866
|
+
*/
|
|
860
867
|
export const CredentialGrantToken = "token";
|
|
861
868
|
export const NotificationChannelEmail = "email";
|
|
862
869
|
export const NotificationChannelSMS = "sms";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inferencesh/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"url": "https://github.com/inference-sh/sdk-js/issues"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
|
-
"node": ">=
|
|
76
|
+
"node": ">=22.12.0"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"eventsource": "^
|
|
79
|
+
"eventsource": "^5.1.1"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@sveltejs/kit": "^2.60.1",
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"@types/jest": "^30.0.0",
|
|
85
85
|
"@types/node": "^26.1.1",
|
|
86
86
|
"@types/react": "^19.1.12",
|
|
87
|
-
"@eslint/js": "^
|
|
87
|
+
"@eslint/js": "^10.0.1",
|
|
88
88
|
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
89
89
|
"@typescript-eslint/parser": "^8.65.0",
|
|
90
|
-
"eslint": "^
|
|
90
|
+
"eslint": "^10.10.0",
|
|
91
91
|
"eslint-config-prettier": "^10.1.8",
|
|
92
|
-
"globals": "^
|
|
92
|
+
"globals": "^17.12.0",
|
|
93
93
|
"hono": "^4.13.1",
|
|
94
94
|
"jest": "^30.4.2",
|
|
95
95
|
"next": "^16.2.6",
|