edgegate-mcp 0.4.0 → 0.7.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.
Files changed (66) hide show
  1. package/README.md +22 -3
  2. package/dist/client.d.ts +27 -1
  3. package/dist/client.js +55 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/server.js +135 -0
  6. package/dist/server.js.map +1 -1
  7. package/dist/tools/change_member_role.d.ts +18 -0
  8. package/dist/tools/change_member_role.js +61 -0
  9. package/dist/tools/change_member_role.js.map +1 -0
  10. package/dist/tools/connect_huggingface.d.ts +15 -0
  11. package/dist/tools/connect_huggingface.js +83 -0
  12. package/dist/tools/connect_huggingface.js.map +1 -0
  13. package/dist/tools/connect_qaihub.d.ts +15 -0
  14. package/dist/tools/connect_qaihub.js +62 -0
  15. package/dist/tools/connect_qaihub.js.map +1 -0
  16. package/dist/tools/create_api_key.d.ts +18 -0
  17. package/dist/tools/create_api_key.js +73 -0
  18. package/dist/tools/create_api_key.js.map +1 -0
  19. package/dist/tools/create_pipeline.d.ts +30 -0
  20. package/dist/tools/create_pipeline.js +31 -0
  21. package/dist/tools/create_pipeline.js.map +1 -1
  22. package/dist/tools/create_workspace.d.ts +12 -0
  23. package/dist/tools/create_workspace.js +51 -0
  24. package/dist/tools/create_workspace.js.map +1 -0
  25. package/dist/tools/disconnect_huggingface.d.ts +12 -0
  26. package/dist/tools/disconnect_huggingface.js +44 -0
  27. package/dist/tools/disconnect_huggingface.js.map +1 -0
  28. package/dist/tools/disconnect_qaihub.d.ts +12 -0
  29. package/dist/tools/disconnect_qaihub.js +42 -0
  30. package/dist/tools/disconnect_qaihub.js.map +1 -0
  31. package/dist/tools/get_huggingface_integration.d.ts +12 -0
  32. package/dist/tools/get_huggingface_integration.js +52 -0
  33. package/dist/tools/get_huggingface_integration.js.map +1 -0
  34. package/dist/tools/get_qaihub_integration.d.ts +12 -0
  35. package/dist/tools/get_qaihub_integration.js +52 -0
  36. package/dist/tools/get_qaihub_integration.js.map +1 -0
  37. package/dist/tools/invite_member.d.ts +18 -0
  38. package/dist/tools/invite_member.js +85 -0
  39. package/dist/tools/invite_member.js.map +1 -0
  40. package/dist/tools/list_api_keys.d.ts +12 -0
  41. package/dist/tools/list_api_keys.js +51 -0
  42. package/dist/tools/list_api_keys.js.map +1 -0
  43. package/dist/tools/list_members.d.ts +12 -0
  44. package/dist/tools/list_members.js +43 -0
  45. package/dist/tools/list_members.js.map +1 -0
  46. package/dist/tools/publish_promptpack.d.ts +18 -0
  47. package/dist/tools/publish_promptpack.js +108 -0
  48. package/dist/tools/publish_promptpack.js.map +1 -0
  49. package/dist/tools/remove_member.d.ts +15 -0
  50. package/dist/tools/remove_member.js +64 -0
  51. package/dist/tools/remove_member.js.map +1 -0
  52. package/dist/tools/revoke_api_key.d.ts +15 -0
  53. package/dist/tools/revoke_api_key.js +49 -0
  54. package/dist/tools/revoke_api_key.js.map +1 -0
  55. package/dist/types.d.ts +84 -0
  56. package/dist/version.d.ts +2 -2
  57. package/dist/version.js +1 -1
  58. package/package.json +1 -1
  59. package/plugin.json +6 -2
  60. package/skills/edgegate-connect-huggingface.md +64 -0
  61. package/skills/edgegate-connect-qaihub.md +56 -0
  62. package/skills/edgegate-import.md +2 -2
  63. package/skills/edgegate-init.md +17 -0
  64. package/skills/edgegate-members.md +51 -0
  65. package/skills/edgegate-promptpacks.md +22 -5
  66. package/skills/edgegate-workspace-setup.md +74 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@ MCP server for [EdgeGate](https://edgegate.frozo.ai) — set up edge-AI regressi
4
4
 
5
5
  ## What does it do?
6
6
 
7
- EdgeGate runs AI model regression tests on real Snapdragon hardware via Qualcomm AI Hub, then produces signed evidence bundles you can attach to CI gates. This npm package exposes EdgeGate's REST API as 12 MCP tools, plus bundled skills, so you can drive the whole flow from a prompt:
7
+ EdgeGate runs AI model regression tests on real Snapdragon hardware via Qualcomm AI Hub, then produces signed evidence bundles you can attach to CI gates. This npm package exposes EdgeGate's REST API as 13 MCP tools, plus bundled skills, so you can drive the whole flow from a prompt:
8
8
 
9
9
  ```
10
10
  > Use the edgegate MCP to set up a CI gate for my MobileNet ONNX model.
@@ -69,9 +69,24 @@ See [docs/tools.md](./docs/tools.md) for the full tool reference. Quick list:
69
69
  | `edgegate_setup_github_action` | Generate the GitHub Actions workflow + secret commands |
70
70
  | `edgegate_compare_runs` | Diff two runs — gate flips, metric deltas, per-device breakdown, REGRESSION / IMPROVEMENT / NEUTRAL verdict |
71
71
  | `edgegate_export_run_report` | Save a complete run report as a markdown file to disk (returns the file path + preview) |
72
- | `edgegate_import_huggingface_model` | Import a public HuggingFace ONNX model — returns artifact_id ready for `edgegate_create_pipeline` |
72
+ | `edgegate_import_huggingface_model` | Import a HuggingFace ONNX model — returns artifact_id ready for `edgegate_create_pipeline`. Uses the workspace's personal HF token when connected; otherwise anonymous |
73
+ | `edgegate_connect_huggingface` | Store a personal HuggingFace token in the workspace so imports can read private / gated / Qualcomm-org repos. Validated against HF whoami before encryption |
74
+ | `edgegate_get_huggingface_integration` | Show whether a HF token is currently connected (no plaintext) |
75
+ | `edgegate_disconnect_huggingface` | Delete the HF integration; future imports fall back to anonymous access |
76
+ | `edgegate_connect_qaihub` | Connect / rotate a Qualcomm AI Hub token (encrypted at rest, never returned in plaintext) |
77
+ | `edgegate_get_qaihub_integration` | Show the connection status of the workspace's AI Hub token |
78
+ | `edgegate_disconnect_qaihub` | Permanently delete the AI Hub integration |
79
+ | `edgegate_create_workspace` | Create a new workspace (caller becomes owner) |
80
+ | `edgegate_list_api_keys` | List API keys in the workspace (no plaintext) |
81
+ | `edgegate_create_api_key` | Mint a new API key — plaintext returned exactly once |
82
+ | `edgegate_revoke_api_key` | Revoke an API key by id (audit row preserved) |
83
+ | `edgegate_list_members` | List members + roles |
84
+ | `edgegate_invite_member` | Add an existing EdgeGate user to the workspace at a given role |
85
+ | `edgegate_change_member_role` | Change a member's role (cannot downgrade the last owner) |
86
+ | `edgegate_remove_member` | Remove a member (their pipelines/runs are preserved) |
73
87
  | `edgegate_list_promptpacks` | List all promptpacks in a workspace (id, version, case count, published status) |
74
88
  | `edgegate_create_promptpack` | Create a new promptpack with test cases (prompts, expected outputs, per-case overrides) |
89
+ | `edgegate_publish_promptpack` | Publish a promptpack version so it is usable in pipelines (completes the create → publish → use lifecycle) |
75
90
 
76
91
  ## Skills
77
92
 
@@ -83,7 +98,11 @@ Slash commands you can invoke directly:
83
98
  - `/edgegate-audit` — fetch the evidence bundle for a run
84
99
  - `/edgegate-compare` — diff two runs (auto-baseline) with REGRESSION/IMPROVEMENT/NEUTRAL verdict
85
100
  - `/edgegate-export` — save a run report as a markdown file (for PR comments, Slack, compliance)
86
- - `/edgegate-import` — import a public Hugging Face ONNX model and get an artifact_id
101
+ - `/edgegate-import` — import a Hugging Face ONNX model (anonymous, or workspace-token for private / gated / qualcomm-org repos)
102
+ - `/edgegate-connect-huggingface` — attach a personal HuggingFace token to the workspace so the import flow can read private / gated / qualcomm-org repos
103
+ - `/edgegate-connect-qaihub` — connect a Qualcomm AI Hub token so runs can actually compile and profile on Snapdragon devices
104
+ - `/edgegate-workspace-setup` — bootstrap a brand-new workspace end-to-end (create → connect AI Hub → API key → invite teammates)
105
+ - `/edgegate-members` — list / invite / change role / remove workspace members
87
106
  - `/edgegate-promptpacks` — list existing promptpacks or create a new one with generated test cases
88
107
 
89
108
  ## License
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { APIKeyCreateResponse, HFImportJob, Pipeline, PromptPackCreateBody, PromptPackSummary, RunBundle, RunComparison, RunDetail, RunSummary, Workspace, WorkflowTemplate } from "./types.js";
1
+ import type { APIKeyCreateResponse, APIKeyCreatedResponse, APIKeyListItem, HFImportJob, HuggingFaceConnectResponse, HuggingFaceIntegrationStatus, InputSpec, Member, Pipeline, PromptPackCreateBody, PromptPackSummary, QaihubIntegration, RunBundle, RunComparison, RunDetail, RunSummary, Workspace, WorkflowTemplate, WorkspaceRole } from "./types.js";
2
2
  export interface EdgeGateClientOptions {
3
3
  apiUrl: string;
4
4
  apiKey: string;
@@ -51,6 +51,9 @@ export declare class EdgeGateClient {
51
51
  artifact_id: string;
52
52
  label?: string;
53
53
  }>;
54
+ /** Optional explicit AI Hub compile input shapes. Omit to let EdgeGate
55
+ * auto-detect from the ONNX file (works for most models). */
56
+ input_specs?: Record<string, InputSpec>;
54
57
  }): Promise<Pipeline>;
55
58
  listPipelines(workspaceId: string): Promise<Pipeline[]>;
56
59
  triggerRun(workspaceId: string, body: {
@@ -70,7 +73,30 @@ export declare class EdgeGateClient {
70
73
  filename?: string;
71
74
  }): Promise<HFImportJob>;
72
75
  getHuggingFaceImportJob(workspaceId: string, jobId: string): Promise<HFImportJob>;
76
+ connectHuggingFaceIntegration(workspaceId: string, token: string): Promise<HuggingFaceConnectResponse>;
77
+ rotateHuggingFaceIntegration(workspaceId: string, token: string): Promise<HuggingFaceConnectResponse>;
78
+ getHuggingFaceIntegration(workspaceId: string): Promise<HuggingFaceIntegrationStatus>;
79
+ deleteHuggingFaceIntegration(workspaceId: string): Promise<void>;
80
+ connectQaihubIntegration(workspaceId: string, token: string): Promise<QaihubIntegration>;
81
+ rotateQaihubIntegration(workspaceId: string, token: string): Promise<QaihubIntegration>;
82
+ getQaihubIntegration(workspaceId: string): Promise<QaihubIntegration>;
83
+ deleteQaihubIntegration(workspaceId: string): Promise<void>;
84
+ createWorkspace(name: string): Promise<Workspace>;
85
+ listApiKeys(workspaceId: string): Promise<APIKeyListItem[]>;
86
+ createApiKey(workspaceId: string, body: {
87
+ name: string;
88
+ expires_at?: string | null;
89
+ }): Promise<APIKeyCreatedResponse>;
90
+ revokeApiKey(workspaceId: string, keyId: string): Promise<void>;
91
+ listMembers(workspaceId: string): Promise<Member[]>;
92
+ addMember(workspaceId: string, body: {
93
+ user_email: string;
94
+ role: WorkspaceRole;
95
+ }): Promise<Member>;
96
+ updateMemberRole(workspaceId: string, userId: string, role: WorkspaceRole): Promise<Member>;
97
+ removeMember(workspaceId: string, userId: string): Promise<void>;
73
98
  listPromptPacks(workspaceId: string): Promise<PromptPackSummary[]>;
74
99
  createPromptPack(workspaceId: string, body: PromptPackCreateBody): Promise<PromptPackSummary>;
100
+ publishPromptPack(workspaceId: string, promptpackId: string, version: string): Promise<PromptPackSummary>;
75
101
  private request;
76
102
  }
package/dist/client.js CHANGED
@@ -66,12 +66,67 @@ export class EdgeGateClient {
66
66
  async getHuggingFaceImportJob(workspaceId, jobId) {
67
67
  return this.request("GET", `/v1/workspaces/${workspaceId}/artifacts/import-huggingface/${jobId}`);
68
68
  }
69
+ async connectHuggingFaceIntegration(workspaceId, token) {
70
+ return this.request("POST", `/v1/workspaces/${workspaceId}/integrations/huggingface`, { token });
71
+ }
72
+ async rotateHuggingFaceIntegration(workspaceId, token) {
73
+ return this.request("PUT", `/v1/workspaces/${workspaceId}/integrations/huggingface/rotate`, { token });
74
+ }
75
+ async getHuggingFaceIntegration(workspaceId) {
76
+ return this.request("GET", `/v1/workspaces/${workspaceId}/integrations/huggingface`);
77
+ }
78
+ async deleteHuggingFaceIntegration(workspaceId) {
79
+ await this.request("DELETE", `/v1/workspaces/${workspaceId}/integrations/huggingface`);
80
+ }
81
+ // Qualcomm AI Hub integration ─────────────────────────────────────────
82
+ async connectQaihubIntegration(workspaceId, token) {
83
+ return this.request("POST", `/v1/workspaces/${workspaceId}/integrations/qaihub`, { token });
84
+ }
85
+ async rotateQaihubIntegration(workspaceId, token) {
86
+ return this.request("PUT", `/v1/workspaces/${workspaceId}/integrations/qaihub/rotate`, { token });
87
+ }
88
+ async getQaihubIntegration(workspaceId) {
89
+ return this.request("GET", `/v1/workspaces/${workspaceId}/integrations/qaihub`);
90
+ }
91
+ async deleteQaihubIntegration(workspaceId) {
92
+ await this.request("DELETE", `/v1/workspaces/${workspaceId}/integrations/qaihub`);
93
+ }
94
+ // Workspace CRUD ─────────────────────────────────────────────────────
95
+ async createWorkspace(name) {
96
+ return this.request("POST", `/v1/workspaces`, { name });
97
+ }
98
+ // API keys ───────────────────────────────────────────────────────────
99
+ async listApiKeys(workspaceId) {
100
+ return this.request("GET", `/v1/workspaces/${workspaceId}/api-keys`);
101
+ }
102
+ async createApiKey(workspaceId, body) {
103
+ return this.request("POST", `/v1/workspaces/${workspaceId}/api-keys`, body);
104
+ }
105
+ async revokeApiKey(workspaceId, keyId) {
106
+ await this.request("DELETE", `/v1/workspaces/${workspaceId}/api-keys/${keyId}`);
107
+ }
108
+ // Members ────────────────────────────────────────────────────────────
109
+ async listMembers(workspaceId) {
110
+ return this.request("GET", `/v1/workspaces/${workspaceId}/members`);
111
+ }
112
+ async addMember(workspaceId, body) {
113
+ return this.request("POST", `/v1/workspaces/${workspaceId}/members`, body);
114
+ }
115
+ async updateMemberRole(workspaceId, userId, role) {
116
+ return this.request("PUT", `/v1/workspaces/${workspaceId}/members/${userId}`, { role });
117
+ }
118
+ async removeMember(workspaceId, userId) {
119
+ await this.request("DELETE", `/v1/workspaces/${workspaceId}/members/${userId}`);
120
+ }
69
121
  async listPromptPacks(workspaceId) {
70
122
  return this.request("GET", `/v1/workspaces/${workspaceId}/promptpacks`);
71
123
  }
72
124
  async createPromptPack(workspaceId, body) {
73
125
  return this.request("POST", `/v1/workspaces/${workspaceId}/promptpacks`, body);
74
126
  }
127
+ async publishPromptPack(workspaceId, promptpackId, version) {
128
+ return this.request("PUT", `/v1/workspaces/${workspaceId}/promptpacks/${promptpackId}/${version}/publish`);
129
+ }
75
130
  async request(method, path, body) {
76
131
  const url = `${this.apiUrl}${path}`;
77
132
  const isIdempotent = method === "GET";
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB1C,MAAM,OAAO,aAAc,SAAQ,KAAK;IAEpB;IACA;IACA;IAHlB,YACkB,MAAc,EACd,MAAc,EACd,GAAW;QAE3B,KAAK,CAAC,YAAY,MAAM,OAAO,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AAI,CAAC,MAAM,IAAI,GAAG,IAAI,YAAY,IAAI,OAAO,GAAG,QAAQ,EAAE,CAAC;gBAC7D,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC/B,SAAS;YACX,CAAC;YACD,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AACzD,CAAC;AACD,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
package/dist/server.js CHANGED
@@ -16,6 +16,21 @@ import { exportRunReportHandler, exportRunReportInputSchema, } from "./tools/exp
16
16
  import { importHuggingfaceModelHandler, importHuggingfaceModelInputSchema, } from "./tools/import_huggingface_model.js";
17
17
  import { listPromptpacksHandler, listPromptpacksInputSchema, } from "./tools/list_promptpacks.js";
18
18
  import { createPromptpackHandler, createPromptpackInputSchema, } from "./tools/create_promptpack.js";
19
+ import { publishPromptpackHandler, publishPromptpackInputSchema, } from "./tools/publish_promptpack.js";
20
+ import { connectHuggingfaceHandler, connectHuggingfaceInputSchema, } from "./tools/connect_huggingface.js";
21
+ import { disconnectHuggingfaceHandler, disconnectHuggingfaceInputSchema, } from "./tools/disconnect_huggingface.js";
22
+ import { getHuggingfaceIntegrationHandler, getHuggingfaceIntegrationInputSchema, } from "./tools/get_huggingface_integration.js";
23
+ import { connectQaihubHandler, connectQaihubInputSchema, } from "./tools/connect_qaihub.js";
24
+ import { getQaihubIntegrationHandler, getQaihubIntegrationInputSchema, } from "./tools/get_qaihub_integration.js";
25
+ import { disconnectQaihubHandler, disconnectQaihubInputSchema, } from "./tools/disconnect_qaihub.js";
26
+ import { createWorkspaceHandler, createWorkspaceInputSchema, } from "./tools/create_workspace.js";
27
+ import { listApiKeysHandler, listApiKeysInputSchema, } from "./tools/list_api_keys.js";
28
+ import { createApiKeyHandler, createApiKeyInputSchema, } from "./tools/create_api_key.js";
29
+ import { revokeApiKeyHandler, revokeApiKeyInputSchema, } from "./tools/revoke_api_key.js";
30
+ import { listMembersHandler, listMembersInputSchema, } from "./tools/list_members.js";
31
+ import { inviteMemberHandler, inviteMemberInputSchema, } from "./tools/invite_member.js";
32
+ import { changeMemberRoleHandler, changeMemberRoleInputSchema, } from "./tools/change_member_role.js";
33
+ import { removeMemberHandler, removeMemberInputSchema, } from "./tools/remove_member.js";
19
34
  const TOOLS = [
20
35
  {
21
36
  name: "edgegate_setup_workspace",
@@ -108,6 +123,126 @@ const TOOLS = [
108
123
  schema: createPromptpackInputSchema,
109
124
  handler: createPromptpackHandler,
110
125
  },
126
+ {
127
+ name: "edgegate_publish_promptpack",
128
+ description: "Publish a promptpack version in an EdgeGate workspace so it can be referenced in " +
129
+ "pipelines. Newly created packs start as unpublished — call this after " +
130
+ "edgegate_create_promptpack to complete the create → publish → use lifecycle. " +
131
+ "Requires admin role on the workspace. The operation is idempotent.",
132
+ schema: publishPromptpackInputSchema,
133
+ handler: publishPromptpackHandler,
134
+ },
135
+ {
136
+ name: "edgegate_connect_huggingface",
137
+ description: "Store a personal HuggingFace access token for this workspace so the import flow " +
138
+ "can read private / gated / Qualcomm-org repos (most qualcomm/*, Intel/*, and many " +
139
+ "Xenova/* repos 401 the anonymous endpoint). The token is validated against HF " +
140
+ "whoami before encryption and is never echoed in plaintext. If an integration " +
141
+ "already exists this tool rotates the token. Requires admin role.",
142
+ schema: connectHuggingfaceInputSchema,
143
+ handler: connectHuggingfaceHandler,
144
+ },
145
+ {
146
+ name: "edgegate_get_huggingface_integration",
147
+ description: "Show whether a personal HuggingFace token is connected to this workspace (and " +
148
+ "whether it is currently active or disabled). Does not return the token itself.",
149
+ schema: getHuggingfaceIntegrationInputSchema,
150
+ handler: getHuggingfaceIntegrationHandler,
151
+ },
152
+ {
153
+ name: "edgegate_disconnect_huggingface",
154
+ description: "Permanently delete the workspace's HuggingFace integration. Future HF imports fall " +
155
+ "back to anonymous access. Requires owner role.",
156
+ schema: disconnectHuggingfaceInputSchema,
157
+ handler: disconnectHuggingfaceHandler,
158
+ },
159
+ {
160
+ name: "edgegate_connect_qaihub",
161
+ description: "Store a Qualcomm AI Hub API token for this workspace so EdgeGate can submit " +
162
+ "compile + profile jobs on real Snapdragon devices. The token is encrypted at " +
163
+ "rest and is never returned in plaintext after the initial connect. If an " +
164
+ "integration already exists this tool transparently rotates the token. Requires " +
165
+ "admin role.",
166
+ schema: connectQaihubInputSchema,
167
+ handler: connectQaihubHandler,
168
+ },
169
+ {
170
+ name: "edgegate_get_qaihub_integration",
171
+ description: "Show whether a Qualcomm AI Hub token is connected to this workspace and " +
172
+ "whether it is currently active. Does not return the token itself.",
173
+ schema: getQaihubIntegrationInputSchema,
174
+ handler: getQaihubIntegrationHandler,
175
+ },
176
+ {
177
+ name: "edgegate_disconnect_qaihub",
178
+ description: "Permanently delete the workspace's Qualcomm AI Hub integration. Any new EdgeGate " +
179
+ "runs in this workspace will then fail with NO_AIHUB_TOKEN until a fresh token is " +
180
+ "connected. Requires owner role.",
181
+ schema: disconnectQaihubInputSchema,
182
+ handler: disconnectQaihubHandler,
183
+ },
184
+ {
185
+ name: "edgegate_create_workspace",
186
+ description: "Create a new EdgeGate workspace. The caller automatically becomes the owner. " +
187
+ "Subject to plan-tier workspace limits. After creation, connect Qualcomm AI Hub " +
188
+ "and define pipelines as usual.",
189
+ schema: createWorkspaceInputSchema,
190
+ handler: createWorkspaceHandler,
191
+ },
192
+ {
193
+ name: "edgegate_list_api_keys",
194
+ description: "List all API keys in this workspace (id, name, prefix...suffix, status, last_used). " +
195
+ "Plaintext is never returned. Requires owner role.",
196
+ schema: listApiKeysInputSchema,
197
+ handler: listApiKeysHandler,
198
+ },
199
+ {
200
+ name: "edgegate_create_api_key",
201
+ description: "Create a new API key for this workspace. The plaintext token is returned EXACTLY " +
202
+ "ONCE in the response — copy it to your CI secrets or local env immediately. " +
203
+ "Requires Pro tier or above. Requires owner role.",
204
+ schema: createApiKeyInputSchema,
205
+ handler: createApiKeyHandler,
206
+ },
207
+ {
208
+ name: "edgegate_revoke_api_key",
209
+ description: "Revoke an API key by id. The key is immediately rejected for all subsequent " +
210
+ "requests; the row is preserved (with revoked_at set) so the audit trail survives. " +
211
+ "Destructive. Requires owner role.",
212
+ schema: revokeApiKeyInputSchema,
213
+ handler: revokeApiKeyHandler,
214
+ },
215
+ {
216
+ name: "edgegate_list_members",
217
+ description: "List all members of this workspace with their email + role. Requires at least " +
218
+ "viewer role.",
219
+ schema: listMembersInputSchema,
220
+ handler: listMembersHandler,
221
+ },
222
+ {
223
+ name: "edgegate_invite_member",
224
+ description: "Add an existing EdgeGate user to this workspace by email at the given role " +
225
+ "(owner / admin / viewer). v1 only attaches existing users — does not send " +
226
+ "invitation emails to external addresses. Requires admin role; only owners can " +
227
+ "add other owners.",
228
+ schema: inviteMemberInputSchema,
229
+ handler: inviteMemberHandler,
230
+ },
231
+ {
232
+ name: "edgegate_change_member_role",
233
+ description: "Change a member's role in this workspace. Cannot downgrade the last owner — " +
234
+ "promote another member to owner first. Requires owner role.",
235
+ schema: changeMemberRoleInputSchema,
236
+ handler: changeMemberRoleHandler,
237
+ },
238
+ {
239
+ name: "edgegate_remove_member",
240
+ description: "Remove a member from this workspace. The user loses access immediately; their " +
241
+ "pipelines and runs are preserved. Cannot remove the last owner. Destructive. " +
242
+ "Requires owner role.",
243
+ schema: removeMemberInputSchema,
244
+ handler: removeMemberHandler,
245
+ },
111
246
  ];
112
247
  function getClient() {
113
248
  const apiUrl = process.env.EDGEGATE_API_URL ?? "https://edgegateapi.frozo.ai";
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAC5B,MA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C,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ import { EdgeGateClient } from "../client.js";
3
+ import type { ToolResult } from "./setup_workspace.js";
4
+ export declare const changeMemberRoleInputSchema: z.ZodObject<{
5
+ workspace_id: z.ZodString;
6
+ user_id: z.ZodString;
7
+ role: z.ZodEnum<["owner", "admin", "viewer"]>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ workspace_id: string;
10
+ role: "owner" | "admin" | "viewer";
11
+ user_id: string;
12
+ }, {
13
+ workspace_id: string;
14
+ role: "owner" | "admin" | "viewer";
15
+ user_id: string;
16
+ }>;
17
+ export type ChangeMemberRoleInput = z.infer<typeof changeMemberRoleInputSchema>;
18
+ export declare function changeMemberRoleHandler(client: EdgeGateClient, input: ChangeMemberRoleInput): Promise<ToolResult>;
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ import { EdgeGateError } from "../client.js";
3
+ export const changeMemberRoleInputSchema = z.object({
4
+ workspace_id: z.string().uuid(),
5
+ user_id: z
6
+ .string()
7
+ .uuid()
8
+ .describe("Target member's user_id (from `edgegate_list_members`)."),
9
+ role: z
10
+ .enum(["owner", "admin", "viewer"])
11
+ .describe("The new role. Requires the caller to be a workspace owner."),
12
+ });
13
+ export async function changeMemberRoleHandler(client, input) {
14
+ try {
15
+ const member = await client.updateMemberRole(input.workspace_id, input.user_id, input.role);
16
+ return {
17
+ content: [
18
+ {
19
+ type: "text",
20
+ text: `Updated **${member.email}** to **${member.role}** in this workspace.`,
21
+ },
22
+ ],
23
+ };
24
+ }
25
+ catch (err) {
26
+ if (err instanceof EdgeGateError) {
27
+ if (err.status === 400) {
28
+ // Most likely "Cannot remove the last owner from workspace".
29
+ return {
30
+ isError: true,
31
+ content: [
32
+ {
33
+ type: "text",
34
+ text: `Role change rejected: ${err.detail}\n\n` +
35
+ `If you're trying to downgrade the last owner, first promote ` +
36
+ `another member to owner via this tool, then come back to ` +
37
+ `downgrade the original owner.`,
38
+ },
39
+ ],
40
+ };
41
+ }
42
+ if (err.status === 404) {
43
+ return {
44
+ isError: true,
45
+ content: [
46
+ {
47
+ type: "text",
48
+ text: `User \`${input.user_id}\` is not a member of this workspace.`,
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ return {
54
+ isError: true,
55
+ content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
56
+ };
57
+ }
58
+ throw err;
59
+ }
60
+ }
61
+ //# sourceMappingURL=change_member_role.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change_member_role.js","sourceRoot":"","sources":["../../src/tools/change_member_role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,CAAC,yDAAyD,CAAC;IACtE,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;SAClC,QAAQ,CAAC,4DAA4D,CAAC;CAC1E,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAsB,EACtB,KAA4B;IAE5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAC1C,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,IAAI,CACX,CAAC;QACF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,aAAa,MAAM,CAAC,KAAK,WAAW,MAAM,CAAC,IAAI,uBAAuB;iBAC7E;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,aAAa,EAAE,CAAC;YACjC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,6DAA6D;gBAC7D,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EACF,yBAAyB,GAAG,CAAC,MAAM,MAAM;gCACzC,8DAA8D;gCAC9D,2DAA2D;gCAC3D,+BAA+B;yBAClC;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,UAAU,KAAK,CAAC,OAAO,uCAAuC;yBACrE;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import { EdgeGateClient } from "../client.js";
3
+ import type { ToolResult } from "./setup_workspace.js";
4
+ export declare const connectHuggingfaceInputSchema: z.ZodObject<{
5
+ workspace_id: z.ZodString;
6
+ token: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ workspace_id: string;
9
+ token: string;
10
+ }, {
11
+ workspace_id: string;
12
+ token: string;
13
+ }>;
14
+ export type ConnectHuggingfaceInput = z.infer<typeof connectHuggingfaceInputSchema>;
15
+ export declare function connectHuggingfaceHandler(client: EdgeGateClient, input: ConnectHuggingfaceInput): Promise<ToolResult>;
@@ -0,0 +1,83 @@
1
+ import { z } from "zod";
2
+ import { EdgeGateError } from "../client.js";
3
+ export const connectHuggingfaceInputSchema = z.object({
4
+ workspace_id: z.string().uuid(),
5
+ token: z
6
+ .string()
7
+ .min(8)
8
+ .describe("Personal HuggingFace access token (starts with hf_). Generate one at " +
9
+ "https://huggingface.co/settings/tokens — Read scope is enough for the " +
10
+ "import flow."),
11
+ });
12
+ export async function connectHuggingfaceHandler(client, input) {
13
+ try {
14
+ const result = await client.connectHuggingFaceIntegration(input.workspace_id, input.token);
15
+ return {
16
+ content: [
17
+ {
18
+ type: "text",
19
+ text: [
20
+ `Connected HuggingFace as **${result.account_name}** (${result.account_type}).`,
21
+ ``,
22
+ `- token: \`****${result.token_last4}\` (encrypted at rest, never echoed)`,
23
+ `- status: ${result.status}`,
24
+ ``,
25
+ `EdgeGate will now use this token for \`edgegate_import_huggingface_model\` calls in this workspace, so private / gated / Qualcomm-org repos work end-to-end.`,
26
+ `Rotate by calling this tool again with a fresh token; remove with \`edgegate_disconnect_huggingface\`.`,
27
+ ].join("\n"),
28
+ },
29
+ ],
30
+ };
31
+ }
32
+ catch (err) {
33
+ if (err instanceof EdgeGateError) {
34
+ if (err.status === 409) {
35
+ // Integration already exists — try rotating instead.
36
+ try {
37
+ const rotated = await client.rotateHuggingFaceIntegration(input.workspace_id, input.token);
38
+ return {
39
+ content: [
40
+ {
41
+ type: "text",
42
+ text: [
43
+ `Replaced existing HuggingFace token for account **${rotated.account_name}**.`,
44
+ ``,
45
+ `- token: \`****${rotated.token_last4}\``,
46
+ `- status: ${rotated.status}`,
47
+ ].join("\n"),
48
+ },
49
+ ],
50
+ };
51
+ }
52
+ catch (rotateErr) {
53
+ if (rotateErr instanceof EdgeGateError) {
54
+ return formatError(rotateErr);
55
+ }
56
+ throw rotateErr;
57
+ }
58
+ }
59
+ return formatError(err);
60
+ }
61
+ throw err;
62
+ }
63
+ }
64
+ function formatError(err) {
65
+ if (err.status === 400) {
66
+ return {
67
+ isError: true,
68
+ content: [
69
+ {
70
+ type: "text",
71
+ text: `HuggingFace rejected the token: ${err.detail}\n\n` +
72
+ `Generate a fresh token at https://huggingface.co/settings/tokens — the ` +
73
+ `default "Read" scope is sufficient.`,
74
+ },
75
+ ],
76
+ };
77
+ }
78
+ return {
79
+ isError: true,
80
+ content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
81
+ };
82
+ }
83
+ //# sourceMappingURL=connect_huggingface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect_huggingface.js","sourceRoot":"","sources":["../../src/tools/connect_huggingface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,uEAAuE;QACrE,wEAAwE;QACxE,cAAc,CACjB;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAsB,EACtB,KAA8B;IAE9B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,6BAA6B,CACvD,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,KAAK,CACZ,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;wBACJ,8BAA8B,MAAM,CAAC,YAAY,OAAO,MAAM,CAAC,YAAY,IAAI;wBAC/E,EAAE;wBACF,kBAAkB,MAAM,CAAC,WAAW,sCAAsC;wBAC1E,aAAa,MAAM,CAAC,MAAM,EAAE;wBAC5B,EAAE;wBACF,8JAA8J;wBAC9J,wGAAwG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O,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;KACpF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import { EdgeGateClient } from "../client.js";
3
+ import type { ToolResult } from "./setup_workspace.js";
4
+ export declare const connectQaihubInputSchema: z.ZodObject<{
5
+ workspace_id: z.ZodString;
6
+ token: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ workspace_id: string;
9
+ token: string;
10
+ }, {
11
+ workspace_id: string;
12
+ token: string;
13
+ }>;
14
+ export type ConnectQaihubInput = z.infer<typeof connectQaihubInputSchema>;
15
+ export declare function connectQaihubHandler(client: EdgeGateClient, input: ConnectQaihubInput): Promise<ToolResult>;
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ import { EdgeGateError } from "../client.js";
3
+ export const connectQaihubInputSchema = z.object({
4
+ workspace_id: z.string().uuid(),
5
+ token: z
6
+ .string()
7
+ .min(8)
8
+ .describe("Qualcomm AI Hub API token. Generate one at " +
9
+ "https://app.aihub.qualcomm.com/account/api-token — it's the same token " +
10
+ "you'd export as QAIHUB_API_TOKEN in a local SDK setup."),
11
+ });
12
+ export async function connectQaihubHandler(client, input) {
13
+ try {
14
+ const result = await client.connectQaihubIntegration(input.workspace_id, input.token);
15
+ return successText(result, "Connected");
16
+ }
17
+ catch (err) {
18
+ if (err instanceof EdgeGateError) {
19
+ if (err.status === 409) {
20
+ // Already exists — rotate transparently. Users don't have to think
21
+ // about "is there already a token here" — the right thing happens
22
+ // on the second call too.
23
+ try {
24
+ const rotated = await client.rotateQaihubIntegration(input.workspace_id, input.token);
25
+ return successText(rotated, "Replaced");
26
+ }
27
+ catch (rotateErr) {
28
+ if (rotateErr instanceof EdgeGateError) {
29
+ return formatError(rotateErr);
30
+ }
31
+ throw rotateErr;
32
+ }
33
+ }
34
+ return formatError(err);
35
+ }
36
+ throw err;
37
+ }
38
+ }
39
+ function successText(result, verb) {
40
+ return {
41
+ content: [
42
+ {
43
+ type: "text",
44
+ text: [
45
+ `${verb} Qualcomm AI Hub integration for this workspace.`,
46
+ ``,
47
+ `- token: \`****${result.token_last4}\` (encrypted at rest, never echoed)`,
48
+ `- status: ${result.status}`,
49
+ ``,
50
+ `EdgeGate runs in this workspace will now use this token to compile + profile models on real Snapdragon devices via Qualcomm AI Hub.`,
51
+ ].join("\n"),
52
+ },
53
+ ],
54
+ };
55
+ }
56
+ function formatError(err) {
57
+ return {
58
+ isError: true,
59
+ content: [{ type: "text", text: `EdgeGate returned ${err.status}: ${err.detail}` }],
60
+ };
61
+ }
62
+ //# sourceMappingURL=connect_qaihub.js.map