@slicervm/sdk 0.1.9 → 0.1.11
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/index.cjs +52 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -4
- package/dist/index.d.ts +62 -4
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -27,6 +27,15 @@ interface VMInfo {
|
|
|
27
27
|
status?: string;
|
|
28
28
|
persistent?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface VMTagResponse {
|
|
31
|
+
hostname: string;
|
|
32
|
+
tags: string[];
|
|
33
|
+
}
|
|
34
|
+
interface VMTagUpdate {
|
|
35
|
+
add?: string[];
|
|
36
|
+
remove?: string[];
|
|
37
|
+
replace?: string[];
|
|
38
|
+
}
|
|
30
39
|
/**
|
|
31
40
|
* Per-launch network policy override for isolated host groups.
|
|
32
41
|
* Omitted lists inherit the host group's policy. Empty lists intentionally
|
|
@@ -650,6 +659,7 @@ interface VMInit {
|
|
|
650
659
|
ip?: string;
|
|
651
660
|
createdAt?: string;
|
|
652
661
|
arch?: string;
|
|
662
|
+
tags?: string[];
|
|
653
663
|
}
|
|
654
664
|
declare class CommittedVM {
|
|
655
665
|
private readonly transport;
|
|
@@ -672,10 +682,16 @@ declare class VM {
|
|
|
672
682
|
readonly ip?: string;
|
|
673
683
|
readonly createdAt?: string;
|
|
674
684
|
readonly arch?: string;
|
|
685
|
+
tags?: string[];
|
|
675
686
|
readonly fs: VMFileSystem;
|
|
676
687
|
readonly bg: VMBg;
|
|
677
688
|
private readonly transport;
|
|
678
689
|
constructor(transport: TransportClient, init: VMInit);
|
|
690
|
+
getTags(): Promise<string[]>;
|
|
691
|
+
updateTags(update: VMTagUpdate): Promise<string[]>;
|
|
692
|
+
addTags(...tags: string[]): Promise<string[]>;
|
|
693
|
+
removeTags(...tags: string[]): Promise<string[]>;
|
|
694
|
+
replaceTags(tags: string[]): Promise<string[]>;
|
|
679
695
|
delete(): Promise<void>;
|
|
680
696
|
health(): Promise<AgentHealth>;
|
|
681
697
|
logs(): Promise<VMLogs>;
|
|
@@ -854,12 +870,24 @@ declare class SecretsAPI {
|
|
|
854
870
|
*/
|
|
855
871
|
|
|
856
872
|
/** Credential type for upstream injection. */
|
|
857
|
-
type ProxySecretType = 'bearer' | 'basic' | 'oauth-client-creds';
|
|
873
|
+
type ProxySecretType = 'bearer' | 'basic' | 'oauth-client-creds' | 'oauth-codex' | 'oauth-claude' | 'oauth-github-copilot' | 'oauth-xai' | 'github-app-user' | 'github-app';
|
|
858
874
|
declare const ProxySecretBearer: ProxySecretType;
|
|
859
875
|
/** For basic auth, the secret value must be in `user:pass` form. */
|
|
860
876
|
declare const ProxySecretBasic: ProxySecretType;
|
|
861
877
|
/** OAuth 2.0 client credentials exchanged and renewed by the proxy host. */
|
|
862
878
|
declare const ProxySecretOAuthClientCredentials: ProxySecretType;
|
|
879
|
+
/** Adopt and refresh a host-side Codex ChatGPT OAuth credential. */
|
|
880
|
+
declare const ProxySecretOAuthCodex: ProxySecretType;
|
|
881
|
+
/** Adopt and refresh a host-side Claude Code OAuth credential. */
|
|
882
|
+
declare const ProxySecretOAuthClaude: ProxySecretType;
|
|
883
|
+
/** Adopt and refresh a host-side GitHub Copilot OAuth credential. */
|
|
884
|
+
declare const ProxySecretOAuthGitHubCopilot: ProxySecretType;
|
|
885
|
+
/** Adopt and refresh a host-side xAI Grok OAuth credential. */
|
|
886
|
+
declare const ProxySecretOAuthXAI: ProxySecretType;
|
|
887
|
+
/** Adopt and refresh a host-side GitHub App user OAuth credential. */
|
|
888
|
+
declare const ProxySecretGitHubAppUser: ProxySecretType;
|
|
889
|
+
/** Adopt a host-side GitHub App tuple and inject installation-token Git auth. */
|
|
890
|
+
declare const ProxySecretGitHubApp: ProxySecretType;
|
|
863
891
|
/** A registered proxy client. Tokens are never returned by list/get. */
|
|
864
892
|
interface ProxyClient {
|
|
865
893
|
name: string;
|
|
@@ -890,6 +918,9 @@ interface ProxySecret {
|
|
|
890
918
|
/** Defaults to `bearer` when empty in older state files. */
|
|
891
919
|
type?: ProxySecretType;
|
|
892
920
|
createdAt: string;
|
|
921
|
+
updatedAt?: string;
|
|
922
|
+
adoptedAt?: string;
|
|
923
|
+
refreshedAt?: string;
|
|
893
924
|
}
|
|
894
925
|
interface CreateProxySecretRequest {
|
|
895
926
|
name: string;
|
|
@@ -902,8 +933,30 @@ interface CreateProxySecretRequest {
|
|
|
902
933
|
* inner request). For `oauth-client-creds`, pass top-level JSON containing
|
|
903
934
|
* `token_endpoint`, `client_id`, and `client_secret`; optional `scope` is
|
|
904
935
|
* supported. The proxy obtains, caches, and renews the bearer host-side.
|
|
936
|
+
* For `oauth-codex`, pass a Codex auth.json or
|
|
937
|
+
* minimal OAuth JSON containing access_token, refresh_token, and
|
|
938
|
+
* account_id. For `oauth-claude`, pass Claude Code's .credentials.json
|
|
939
|
+
* or minimal OAuth JSON containing accessToken and refreshToken. For
|
|
940
|
+
* `oauth-github-copilot`, pass opencode auth.json or minimal OAuth JSON
|
|
941
|
+
* containing a GitHub Copilot gho_* or ghu_* token. For `oauth-xai`, pass JSON
|
|
942
|
+
* emitted by `slicer proxy oauth xai`, or equivalent top-level JSON
|
|
943
|
+
* containing access_token and refresh_token. For `github-app-user`, pass
|
|
944
|
+
* JSON emitted by `slicer proxy oauth github-app-user`, or equivalent
|
|
945
|
+
* top-level JSON containing access_token. The proxy stores and refreshes
|
|
946
|
+
* OAuth credentials host-side. For `github-app`, pass top-level JSON
|
|
947
|
+
* containing app_id and either private_key_file or private_key. With
|
|
948
|
+
* private_key_file, the proxy keeps the PEM file on the host; with
|
|
949
|
+
* private_key, the PEM is stored in proxy state. The proxy mints GitHub App
|
|
950
|
+
* installation tokens in memory and injects Git HTTPS Basic auth for
|
|
951
|
+
* github.com clone/fetch requests.
|
|
905
952
|
*/
|
|
906
953
|
value: string;
|
|
954
|
+
/**
|
|
955
|
+
* Overwrite an existing secret with the same name. Useful after the
|
|
956
|
+
* host-side OAuth login has been refreshed manually and the proxy
|
|
957
|
+
* should re-adopt the credential without rewriting allow rules.
|
|
958
|
+
*/
|
|
959
|
+
force?: boolean;
|
|
907
960
|
}
|
|
908
961
|
/**
|
|
909
962
|
* Per-client allow entry. First-match-wins by declaration order.
|
|
@@ -912,6 +965,8 @@ interface CreateProxySecretRequest {
|
|
|
912
965
|
* on the inner request and substitutes the secret's value.
|
|
913
966
|
* - `methods`/`paths` are optional filters (any-of within each list,
|
|
914
967
|
* all-of across lists). Empty list = any.
|
|
968
|
+
* - `ports` is optional. Empty means the default web ports 80 and 443
|
|
969
|
+
* for backwards compatibility with older host-only rules.
|
|
915
970
|
* - When `passthrough` is true, the proxy splices TCP both ways at
|
|
916
971
|
* CONNECT without terminating TLS. Cert-pinned clients work
|
|
917
972
|
* unchanged. Mutually exclusive with `secret`, `methods`, `paths`;
|
|
@@ -922,6 +977,7 @@ interface ProxyAllowRule {
|
|
|
922
977
|
secret?: string;
|
|
923
978
|
methods?: string[];
|
|
924
979
|
paths?: string[];
|
|
980
|
+
ports?: number[];
|
|
925
981
|
/** RFC 3339 timestamp; absent / zero-value when no expiry. */
|
|
926
982
|
expires?: string;
|
|
927
983
|
passthrough?: boolean;
|
|
@@ -933,6 +989,7 @@ interface AddProxyAllowRequest {
|
|
|
933
989
|
secret?: string;
|
|
934
990
|
methods?: string[];
|
|
935
991
|
paths?: string[];
|
|
992
|
+
ports?: number[];
|
|
936
993
|
/**
|
|
937
994
|
* Time-to-live in seconds. 0 / omitted = never expires. Resolved to
|
|
938
995
|
* an absolute `expires` timestamp on the returned rule.
|
|
@@ -944,7 +1001,7 @@ interface AddProxyAllowRequest {
|
|
|
944
1001
|
/**
|
|
945
1002
|
* Input to `allows.removeByTuple`. Mirrors the create payload minus
|
|
946
1003
|
* `ttlSeconds` (TTL is mutable lifetime, not part of identity). The
|
|
947
|
-
* proxy matches the rule by (host, methods, paths, passthrough) and
|
|
1004
|
+
* proxy matches the rule by (host, methods, paths, ports, passthrough) and
|
|
948
1005
|
* removes the single matching rule. Use when several rules share a
|
|
949
1006
|
* host and you want surgical removal of one — pass exactly the same
|
|
950
1007
|
* fields you used at create time.
|
|
@@ -955,6 +1012,7 @@ interface RemoveProxyAllowByTupleRequest {
|
|
|
955
1012
|
secret?: string;
|
|
956
1013
|
methods?: string[];
|
|
957
1014
|
paths?: string[];
|
|
1015
|
+
ports?: number[];
|
|
958
1016
|
passthrough?: boolean;
|
|
959
1017
|
}
|
|
960
1018
|
declare class ProxyAPI {
|
|
@@ -1003,7 +1061,7 @@ declare class ProxyAllowsAPI {
|
|
|
1003
1061
|
remove(client: string, host: string): Promise<void>;
|
|
1004
1062
|
/**
|
|
1005
1063
|
* Surgical revoke: removes the single rule whose
|
|
1006
|
-
* (host, methods, paths, passthrough) tuple matches the request.
|
|
1064
|
+
* (host, methods, paths, ports, passthrough) tuple matches the request.
|
|
1007
1065
|
* Pass exactly the same fields you used at create time. Method and
|
|
1008
1066
|
* host casing are normalised server-side, so `"GET"` / `"get"` and
|
|
1009
1067
|
* `"github.com"` / `"GITHUB.COM"` all match the same stored rule.
|
|
@@ -1109,4 +1167,4 @@ declare class SlicerShellSession {
|
|
|
1109
1167
|
private teardown;
|
|
1110
1168
|
}
|
|
1111
1169
|
|
|
1112
|
-
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1170
|
+
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretGitHubApp, ProxySecretGitHubAppUser, ProxySecretOAuthClaude, ProxySecretOAuthClientCredentials, ProxySecretOAuthCodex, ProxySecretOAuthGitHubCopilot, ProxySecretOAuthXAI, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, type VMTagResponse, type VMTagUpdate, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,15 @@ interface VMInfo {
|
|
|
27
27
|
status?: string;
|
|
28
28
|
persistent?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface VMTagResponse {
|
|
31
|
+
hostname: string;
|
|
32
|
+
tags: string[];
|
|
33
|
+
}
|
|
34
|
+
interface VMTagUpdate {
|
|
35
|
+
add?: string[];
|
|
36
|
+
remove?: string[];
|
|
37
|
+
replace?: string[];
|
|
38
|
+
}
|
|
30
39
|
/**
|
|
31
40
|
* Per-launch network policy override for isolated host groups.
|
|
32
41
|
* Omitted lists inherit the host group's policy. Empty lists intentionally
|
|
@@ -650,6 +659,7 @@ interface VMInit {
|
|
|
650
659
|
ip?: string;
|
|
651
660
|
createdAt?: string;
|
|
652
661
|
arch?: string;
|
|
662
|
+
tags?: string[];
|
|
653
663
|
}
|
|
654
664
|
declare class CommittedVM {
|
|
655
665
|
private readonly transport;
|
|
@@ -672,10 +682,16 @@ declare class VM {
|
|
|
672
682
|
readonly ip?: string;
|
|
673
683
|
readonly createdAt?: string;
|
|
674
684
|
readonly arch?: string;
|
|
685
|
+
tags?: string[];
|
|
675
686
|
readonly fs: VMFileSystem;
|
|
676
687
|
readonly bg: VMBg;
|
|
677
688
|
private readonly transport;
|
|
678
689
|
constructor(transport: TransportClient, init: VMInit);
|
|
690
|
+
getTags(): Promise<string[]>;
|
|
691
|
+
updateTags(update: VMTagUpdate): Promise<string[]>;
|
|
692
|
+
addTags(...tags: string[]): Promise<string[]>;
|
|
693
|
+
removeTags(...tags: string[]): Promise<string[]>;
|
|
694
|
+
replaceTags(tags: string[]): Promise<string[]>;
|
|
679
695
|
delete(): Promise<void>;
|
|
680
696
|
health(): Promise<AgentHealth>;
|
|
681
697
|
logs(): Promise<VMLogs>;
|
|
@@ -854,12 +870,24 @@ declare class SecretsAPI {
|
|
|
854
870
|
*/
|
|
855
871
|
|
|
856
872
|
/** Credential type for upstream injection. */
|
|
857
|
-
type ProxySecretType = 'bearer' | 'basic' | 'oauth-client-creds';
|
|
873
|
+
type ProxySecretType = 'bearer' | 'basic' | 'oauth-client-creds' | 'oauth-codex' | 'oauth-claude' | 'oauth-github-copilot' | 'oauth-xai' | 'github-app-user' | 'github-app';
|
|
858
874
|
declare const ProxySecretBearer: ProxySecretType;
|
|
859
875
|
/** For basic auth, the secret value must be in `user:pass` form. */
|
|
860
876
|
declare const ProxySecretBasic: ProxySecretType;
|
|
861
877
|
/** OAuth 2.0 client credentials exchanged and renewed by the proxy host. */
|
|
862
878
|
declare const ProxySecretOAuthClientCredentials: ProxySecretType;
|
|
879
|
+
/** Adopt and refresh a host-side Codex ChatGPT OAuth credential. */
|
|
880
|
+
declare const ProxySecretOAuthCodex: ProxySecretType;
|
|
881
|
+
/** Adopt and refresh a host-side Claude Code OAuth credential. */
|
|
882
|
+
declare const ProxySecretOAuthClaude: ProxySecretType;
|
|
883
|
+
/** Adopt and refresh a host-side GitHub Copilot OAuth credential. */
|
|
884
|
+
declare const ProxySecretOAuthGitHubCopilot: ProxySecretType;
|
|
885
|
+
/** Adopt and refresh a host-side xAI Grok OAuth credential. */
|
|
886
|
+
declare const ProxySecretOAuthXAI: ProxySecretType;
|
|
887
|
+
/** Adopt and refresh a host-side GitHub App user OAuth credential. */
|
|
888
|
+
declare const ProxySecretGitHubAppUser: ProxySecretType;
|
|
889
|
+
/** Adopt a host-side GitHub App tuple and inject installation-token Git auth. */
|
|
890
|
+
declare const ProxySecretGitHubApp: ProxySecretType;
|
|
863
891
|
/** A registered proxy client. Tokens are never returned by list/get. */
|
|
864
892
|
interface ProxyClient {
|
|
865
893
|
name: string;
|
|
@@ -890,6 +918,9 @@ interface ProxySecret {
|
|
|
890
918
|
/** Defaults to `bearer` when empty in older state files. */
|
|
891
919
|
type?: ProxySecretType;
|
|
892
920
|
createdAt: string;
|
|
921
|
+
updatedAt?: string;
|
|
922
|
+
adoptedAt?: string;
|
|
923
|
+
refreshedAt?: string;
|
|
893
924
|
}
|
|
894
925
|
interface CreateProxySecretRequest {
|
|
895
926
|
name: string;
|
|
@@ -902,8 +933,30 @@ interface CreateProxySecretRequest {
|
|
|
902
933
|
* inner request). For `oauth-client-creds`, pass top-level JSON containing
|
|
903
934
|
* `token_endpoint`, `client_id`, and `client_secret`; optional `scope` is
|
|
904
935
|
* supported. The proxy obtains, caches, and renews the bearer host-side.
|
|
936
|
+
* For `oauth-codex`, pass a Codex auth.json or
|
|
937
|
+
* minimal OAuth JSON containing access_token, refresh_token, and
|
|
938
|
+
* account_id. For `oauth-claude`, pass Claude Code's .credentials.json
|
|
939
|
+
* or minimal OAuth JSON containing accessToken and refreshToken. For
|
|
940
|
+
* `oauth-github-copilot`, pass opencode auth.json or minimal OAuth JSON
|
|
941
|
+
* containing a GitHub Copilot gho_* or ghu_* token. For `oauth-xai`, pass JSON
|
|
942
|
+
* emitted by `slicer proxy oauth xai`, or equivalent top-level JSON
|
|
943
|
+
* containing access_token and refresh_token. For `github-app-user`, pass
|
|
944
|
+
* JSON emitted by `slicer proxy oauth github-app-user`, or equivalent
|
|
945
|
+
* top-level JSON containing access_token. The proxy stores and refreshes
|
|
946
|
+
* OAuth credentials host-side. For `github-app`, pass top-level JSON
|
|
947
|
+
* containing app_id and either private_key_file or private_key. With
|
|
948
|
+
* private_key_file, the proxy keeps the PEM file on the host; with
|
|
949
|
+
* private_key, the PEM is stored in proxy state. The proxy mints GitHub App
|
|
950
|
+
* installation tokens in memory and injects Git HTTPS Basic auth for
|
|
951
|
+
* github.com clone/fetch requests.
|
|
905
952
|
*/
|
|
906
953
|
value: string;
|
|
954
|
+
/**
|
|
955
|
+
* Overwrite an existing secret with the same name. Useful after the
|
|
956
|
+
* host-side OAuth login has been refreshed manually and the proxy
|
|
957
|
+
* should re-adopt the credential without rewriting allow rules.
|
|
958
|
+
*/
|
|
959
|
+
force?: boolean;
|
|
907
960
|
}
|
|
908
961
|
/**
|
|
909
962
|
* Per-client allow entry. First-match-wins by declaration order.
|
|
@@ -912,6 +965,8 @@ interface CreateProxySecretRequest {
|
|
|
912
965
|
* on the inner request and substitutes the secret's value.
|
|
913
966
|
* - `methods`/`paths` are optional filters (any-of within each list,
|
|
914
967
|
* all-of across lists). Empty list = any.
|
|
968
|
+
* - `ports` is optional. Empty means the default web ports 80 and 443
|
|
969
|
+
* for backwards compatibility with older host-only rules.
|
|
915
970
|
* - When `passthrough` is true, the proxy splices TCP both ways at
|
|
916
971
|
* CONNECT without terminating TLS. Cert-pinned clients work
|
|
917
972
|
* unchanged. Mutually exclusive with `secret`, `methods`, `paths`;
|
|
@@ -922,6 +977,7 @@ interface ProxyAllowRule {
|
|
|
922
977
|
secret?: string;
|
|
923
978
|
methods?: string[];
|
|
924
979
|
paths?: string[];
|
|
980
|
+
ports?: number[];
|
|
925
981
|
/** RFC 3339 timestamp; absent / zero-value when no expiry. */
|
|
926
982
|
expires?: string;
|
|
927
983
|
passthrough?: boolean;
|
|
@@ -933,6 +989,7 @@ interface AddProxyAllowRequest {
|
|
|
933
989
|
secret?: string;
|
|
934
990
|
methods?: string[];
|
|
935
991
|
paths?: string[];
|
|
992
|
+
ports?: number[];
|
|
936
993
|
/**
|
|
937
994
|
* Time-to-live in seconds. 0 / omitted = never expires. Resolved to
|
|
938
995
|
* an absolute `expires` timestamp on the returned rule.
|
|
@@ -944,7 +1001,7 @@ interface AddProxyAllowRequest {
|
|
|
944
1001
|
/**
|
|
945
1002
|
* Input to `allows.removeByTuple`. Mirrors the create payload minus
|
|
946
1003
|
* `ttlSeconds` (TTL is mutable lifetime, not part of identity). The
|
|
947
|
-
* proxy matches the rule by (host, methods, paths, passthrough) and
|
|
1004
|
+
* proxy matches the rule by (host, methods, paths, ports, passthrough) and
|
|
948
1005
|
* removes the single matching rule. Use when several rules share a
|
|
949
1006
|
* host and you want surgical removal of one — pass exactly the same
|
|
950
1007
|
* fields you used at create time.
|
|
@@ -955,6 +1012,7 @@ interface RemoveProxyAllowByTupleRequest {
|
|
|
955
1012
|
secret?: string;
|
|
956
1013
|
methods?: string[];
|
|
957
1014
|
paths?: string[];
|
|
1015
|
+
ports?: number[];
|
|
958
1016
|
passthrough?: boolean;
|
|
959
1017
|
}
|
|
960
1018
|
declare class ProxyAPI {
|
|
@@ -1003,7 +1061,7 @@ declare class ProxyAllowsAPI {
|
|
|
1003
1061
|
remove(client: string, host: string): Promise<void>;
|
|
1004
1062
|
/**
|
|
1005
1063
|
* Surgical revoke: removes the single rule whose
|
|
1006
|
-
* (host, methods, paths, passthrough) tuple matches the request.
|
|
1064
|
+
* (host, methods, paths, ports, passthrough) tuple matches the request.
|
|
1007
1065
|
* Pass exactly the same fields you used at create time. Method and
|
|
1008
1066
|
* host casing are normalised server-side, so `"GET"` / `"get"` and
|
|
1009
1067
|
* `"github.com"` / `"GITHUB.COM"` all match the same stored rule.
|
|
@@ -1109,4 +1167,4 @@ declare class SlicerShellSession {
|
|
|
1109
1167
|
private teardown;
|
|
1110
1168
|
}
|
|
1111
1169
|
|
|
1112
|
-
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1170
|
+
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretGitHubApp, ProxySecretGitHubAppUser, ProxySecretOAuthClaude, ProxySecretOAuthClientCredentials, ProxySecretOAuthCodex, ProxySecretOAuthGitHubCopilot, ProxySecretOAuthXAI, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, type VMTagResponse, type VMTagUpdate, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
package/dist/index.js
CHANGED
|
@@ -866,6 +866,7 @@ var VM = class {
|
|
|
866
866
|
ip;
|
|
867
867
|
createdAt;
|
|
868
868
|
arch;
|
|
869
|
+
tags;
|
|
869
870
|
fs;
|
|
870
871
|
bg;
|
|
871
872
|
transport;
|
|
@@ -876,10 +877,37 @@ var VM = class {
|
|
|
876
877
|
if (init.ip !== void 0) this.ip = init.ip;
|
|
877
878
|
if (init.createdAt !== void 0) this.createdAt = init.createdAt;
|
|
878
879
|
if (init.arch !== void 0) this.arch = init.arch;
|
|
880
|
+
if (init.tags !== void 0) this.tags = init.tags;
|
|
879
881
|
this.fs = new VMFileSystem(transport, this.hostname);
|
|
880
882
|
this.bg = new VMBg(transport, this.hostname);
|
|
881
883
|
}
|
|
882
884
|
// --- lifecycle --------------------------------------------------------
|
|
885
|
+
async getTags() {
|
|
886
|
+
const response = await this.transport.request(
|
|
887
|
+
"GET",
|
|
888
|
+
`/vm/${encodeURIComponent(this.hostname)}/tags`
|
|
889
|
+
);
|
|
890
|
+
this.tags = response.tags;
|
|
891
|
+
return response.tags;
|
|
892
|
+
}
|
|
893
|
+
async updateTags(update) {
|
|
894
|
+
const response = await this.transport.request(
|
|
895
|
+
"PATCH",
|
|
896
|
+
`/vm/${encodeURIComponent(this.hostname)}/tags`,
|
|
897
|
+
update
|
|
898
|
+
);
|
|
899
|
+
this.tags = response.tags;
|
|
900
|
+
return response.tags;
|
|
901
|
+
}
|
|
902
|
+
async addTags(...tags) {
|
|
903
|
+
return this.updateTags({ add: tags });
|
|
904
|
+
}
|
|
905
|
+
async removeTags(...tags) {
|
|
906
|
+
return this.updateTags({ remove: tags });
|
|
907
|
+
}
|
|
908
|
+
async replaceTags(tags) {
|
|
909
|
+
return this.updateTags({ replace: tags });
|
|
910
|
+
}
|
|
883
911
|
async delete() {
|
|
884
912
|
await this.transport.request(
|
|
885
913
|
"DELETE",
|
|
@@ -1336,7 +1364,8 @@ var VMsAPI = class {
|
|
|
1336
1364
|
hostGroup: res.hostGroup ?? hostGroup,
|
|
1337
1365
|
...res.ip !== void 0 && { ip: res.ip },
|
|
1338
1366
|
...res.createdAt !== void 0 && { createdAt: res.createdAt },
|
|
1339
|
-
...res.arch !== void 0 && { arch: res.arch }
|
|
1367
|
+
...res.arch !== void 0 && { arch: res.arch },
|
|
1368
|
+
...req.tags !== void 0 && { tags: [...req.tags] }
|
|
1340
1369
|
});
|
|
1341
1370
|
}
|
|
1342
1371
|
/**
|
|
@@ -1356,7 +1385,8 @@ var VMsAPI = class {
|
|
|
1356
1385
|
hostGroup: found.hostGroup ?? "",
|
|
1357
1386
|
...found.ip !== void 0 && { ip: found.ip },
|
|
1358
1387
|
...found.createdAt !== void 0 && { createdAt: found.createdAt },
|
|
1359
|
-
...found.arch !== void 0 && { arch: found.arch }
|
|
1388
|
+
...found.arch !== void 0 && { arch: found.arch },
|
|
1389
|
+
...found.tags !== void 0 && { tags: found.tags }
|
|
1360
1390
|
});
|
|
1361
1391
|
}
|
|
1362
1392
|
/** Return raw VM metadata across all host groups. */
|
|
@@ -1485,6 +1515,12 @@ function validateCommitId2(commitId) {
|
|
|
1485
1515
|
var ProxySecretBearer = "bearer";
|
|
1486
1516
|
var ProxySecretBasic = "basic";
|
|
1487
1517
|
var ProxySecretOAuthClientCredentials = "oauth-client-creds";
|
|
1518
|
+
var ProxySecretOAuthCodex = "oauth-codex";
|
|
1519
|
+
var ProxySecretOAuthClaude = "oauth-claude";
|
|
1520
|
+
var ProxySecretOAuthGitHubCopilot = "oauth-github-copilot";
|
|
1521
|
+
var ProxySecretOAuthXAI = "oauth-xai";
|
|
1522
|
+
var ProxySecretGitHubAppUser = "github-app-user";
|
|
1523
|
+
var ProxySecretGitHubApp = "github-app";
|
|
1488
1524
|
function clientFromWire(w) {
|
|
1489
1525
|
return { name: w.name, createdAt: w.created_at };
|
|
1490
1526
|
}
|
|
@@ -1494,6 +1530,9 @@ function clientCreatedFromWire(w) {
|
|
|
1494
1530
|
function secretFromWire2(w) {
|
|
1495
1531
|
const out = { name: w.name, host: w.host, createdAt: w.created_at };
|
|
1496
1532
|
if (w.type) out.type = w.type;
|
|
1533
|
+
if (w.updated_at && w.updated_at !== "0001-01-01T00:00:00Z") out.updatedAt = w.updated_at;
|
|
1534
|
+
if (w.adopted_at && w.adopted_at !== "0001-01-01T00:00:00Z") out.adoptedAt = w.adopted_at;
|
|
1535
|
+
if (w.refreshed_at && w.refreshed_at !== "0001-01-01T00:00:00Z") out.refreshedAt = w.refreshed_at;
|
|
1497
1536
|
return out;
|
|
1498
1537
|
}
|
|
1499
1538
|
function ruleFromWire(w) {
|
|
@@ -1501,6 +1540,7 @@ function ruleFromWire(w) {
|
|
|
1501
1540
|
if (w.secret) out.secret = w.secret;
|
|
1502
1541
|
if (w.methods && w.methods.length > 0) out.methods = w.methods;
|
|
1503
1542
|
if (w.paths && w.paths.length > 0) out.paths = w.paths;
|
|
1543
|
+
if (w.ports && w.ports.length > 0) out.ports = w.ports;
|
|
1504
1544
|
if (w.expires && w.expires !== "0001-01-01T00:00:00Z") out.expires = w.expires;
|
|
1505
1545
|
if (w.passthrough) out.passthrough = w.passthrough;
|
|
1506
1546
|
return out;
|
|
@@ -1565,6 +1605,7 @@ var ProxySecretsAPI = class {
|
|
|
1565
1605
|
value: req.value
|
|
1566
1606
|
};
|
|
1567
1607
|
if (req.type) body.type = req.type;
|
|
1608
|
+
if (req.force) body.force = true;
|
|
1568
1609
|
await this.transport.request("POST", "/proxy/v1/secrets", body);
|
|
1569
1610
|
}
|
|
1570
1611
|
async list() {
|
|
@@ -1593,6 +1634,7 @@ var ProxyAllowsAPI = class {
|
|
|
1593
1634
|
if (req.secret) body.secret = req.secret;
|
|
1594
1635
|
if (req.methods && req.methods.length > 0) body.methods = req.methods;
|
|
1595
1636
|
if (req.paths && req.paths.length > 0) body.paths = req.paths;
|
|
1637
|
+
if (req.ports && req.ports.length > 0) body.ports = req.ports;
|
|
1596
1638
|
if (req.ttlSeconds && req.ttlSeconds > 0) body.ttl_seconds = req.ttlSeconds;
|
|
1597
1639
|
if (req.passthrough) body.passthrough = true;
|
|
1598
1640
|
const wire = await this.transport.request(
|
|
@@ -1616,7 +1658,7 @@ var ProxyAllowsAPI = class {
|
|
|
1616
1658
|
}
|
|
1617
1659
|
/**
|
|
1618
1660
|
* Surgical revoke: removes the single rule whose
|
|
1619
|
-
* (host, methods, paths, passthrough) tuple matches the request.
|
|
1661
|
+
* (host, methods, paths, ports, passthrough) tuple matches the request.
|
|
1620
1662
|
* Pass exactly the same fields you used at create time. Method and
|
|
1621
1663
|
* host casing are normalised server-side, so `"GET"` / `"get"` and
|
|
1622
1664
|
* `"github.com"` / `"GITHUB.COM"` all match the same stored rule.
|
|
@@ -1631,6 +1673,7 @@ var ProxyAllowsAPI = class {
|
|
|
1631
1673
|
if (req.secret) body.secret = req.secret;
|
|
1632
1674
|
if (req.methods && req.methods.length > 0) body.methods = req.methods;
|
|
1633
1675
|
if (req.paths && req.paths.length > 0) body.paths = req.paths;
|
|
1676
|
+
if (req.ports && req.ports.length > 0) body.ports = req.ports;
|
|
1634
1677
|
if (req.passthrough) body.passthrough = true;
|
|
1635
1678
|
await this.transport.request("POST", "/proxy/v1/allows/revoke", body);
|
|
1636
1679
|
}
|
|
@@ -1807,6 +1850,6 @@ var SlicerShellSession = class {
|
|
|
1807
1850
|
}
|
|
1808
1851
|
};
|
|
1809
1852
|
|
|
1810
|
-
export { CommitsAPI, CommittedVM, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, Forwarder, GiB, HostGroupsAPI, MiB, NonRootUser, ProxyAPI, ProxyAllowsAPI, ProxyClientsAPI, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, ProxySecretsAPI, SecretExistsError, SecretsAPI, SlicerAPIError, SlicerClient, SlicerShellSession, VM, VMBg, VMFileSystem, VMsAPI, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1853
|
+
export { CommitsAPI, CommittedVM, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, Forwarder, GiB, HostGroupsAPI, MiB, NonRootUser, ProxyAPI, ProxyAllowsAPI, ProxyClientsAPI, ProxySecretBasic, ProxySecretBearer, ProxySecretGitHubApp, ProxySecretGitHubAppUser, ProxySecretOAuthClaude, ProxySecretOAuthClientCredentials, ProxySecretOAuthCodex, ProxySecretOAuthGitHubCopilot, ProxySecretOAuthXAI, ProxySecretsAPI, SecretExistsError, SecretsAPI, SlicerAPIError, SlicerClient, SlicerShellSession, VM, VMBg, VMFileSystem, VMsAPI, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1811
1854
|
//# sourceMappingURL=index.js.map
|
|
1812
1855
|
//# sourceMappingURL=index.js.map
|