@amerged/ohmyhost-mcp 0.1.22 → 0.1.24
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 +5 -2
- package/dist/{chunk-NLBFEH6H.js → chunk-EEFUMPKG.js} +25 -24
- package/dist/index.js +1 -1
- package/dist/stdio-main.js +734 -269
- package/package.json +1 -1
- package/src/apps/mcp/package.json +47 -0
- package/src/apps/mcp/{local-client.ts → src/local-client.ts} +69 -12
- package/src/apps/mcp/{local-server.ts → src/local-server.ts} +327 -145
- package/src/apps/product-cli/package.json +45 -0
- package/src/apps/product-cli/{bin.ts → src/bin.ts} +3 -0
- package/src/apps/product-cli/{cli.ts → src/cli.ts} +363 -87
- package/src/apps/product-cli/{command.ts → src/command.ts} +58 -11
- package/src/apps/product-cli/{composition.ts → src/composition.ts} +98 -21
- package/src/apps/product-cli/{index.ts → src/index.ts} +1 -0
- package/src/apps/product-cli/{product-api.ts → src/product-api.ts} +65 -19
- package/src/apps/product-cli/{repository-init.ts → src/repository-init.ts} +79 -29
- package/src/apps/product-cli/{runtime-contract.ts → src/runtime-contract.ts} +16 -309
- package/src/apps/product-cli/{user-token-file.ts → src/user-token-file.ts} +46 -35
- package/src/apps/product-cli/{workspace.ts → src/workspace.ts} +6 -0
- package/src/packages/agent-skills/package.json +24 -0
- package/src/packages/agent-skills/src/generated-skill-resources.ts +165 -0
- package/src/packages/agent-skills/{index.ts → src/index.ts} +1 -1
- package/src/packages/contracts/package.json +137 -0
- package/src/packages/contracts/src/browser-capabilities.ts +133 -0
- package/src/packages/contracts/src/customer-auth-admission.ts +36 -0
- package/src/packages/contracts/{database-access.ts → src/database-access.ts} +10 -2
- package/src/packages/contracts/{framework-admission.ts → src/framework-admission.ts} +88 -13
- package/src/packages/contracts/src/framework-build-script.mjs +22 -0
- package/src/packages/contracts/src/framework-build-script.ts +1 -0
- package/src/packages/contracts/{index.ts → src/index.ts} +17 -16
- package/src/packages/contracts/src/operation-data-change-result.ts +86 -0
- package/src/packages/contracts/{operation-deployment-result.ts → src/operation-deployment-result.ts} +2 -2
- package/src/packages/contracts/{operation-failure.ts → src/operation-failure.ts} +24 -12
- package/src/packages/contracts/src/problem-policy.ts +498 -0
- package/src/packages/contracts/src/project-data-changes.ts +90 -0
- package/src/packages/contracts/src/secret-names.ts +27 -0
- package/src/packages/sdk-ts/package.json +21 -0
- package/src/packages/sdk-ts/{generated → src/generated}/index.ts +15 -0
- package/src/packages/sdk-ts/{generated → src/generated}/sdk.gen.ts +114 -5
- package/src/packages/sdk-ts/{generated → src/generated}/types.gen.ts +209 -10
- package/src/packages/workos-auth-contracts/package.json +39 -0
- package/src/packages/agent-skills/generated-skill-resources.ts +0 -165
- /package/src/apps/mcp/{index.ts → src/index.ts} +0 -0
- /package/src/apps/mcp/{stdio-main.ts → src/stdio-main.ts} +0 -0
- /package/src/apps/product-cli/{credential-store.ts → src/credential-store.ts} +0 -0
- /package/src/apps/product-cli/{device-token-expiry.ts → src/device-token-expiry.ts} +0 -0
- /package/src/apps/product-cli/{file-credential-store.ts → src/file-credential-store.ts} +0 -0
- /package/src/apps/product-cli/{profile-store.ts → src/profile-store.ts} +0 -0
- /package/src/apps/product-cli/{project-link-store.ts → src/project-link-store.ts} +0 -0
- /package/src/apps/product-cli/{psql-session.ts → src/psql-session.ts} +0 -0
- /package/src/packages/contracts/{application-root.ts → src/application-root.ts} +0 -0
- /package/src/packages/contracts/{billing.ts → src/billing.ts} +0 -0
- /package/src/packages/contracts/{credit-pricing.ts → src/credit-pricing.ts} +0 -0
- /package/src/packages/contracts/{database-compute.ts → src/database-compute.ts} +0 -0
- /package/src/packages/contracts/{database-migration-admission.ts → src/database-migration-admission.ts} +0 -0
- /package/src/packages/contracts/{feedback.ts → src/feedback.ts} +0 -0
- /package/src/packages/contracts/{framework-family.ts → src/framework-family.ts} +0 -0
- /package/src/packages/contracts/{functions.ts → src/functions.ts} +0 -0
- /package/src/packages/contracts/{platform-origins.ts → src/platform-origins.ts} +0 -0
- /package/src/packages/contracts/{project-context.ts → src/project-context.ts} +0 -0
- /package/src/packages/contracts/{project-exports.ts → src/project-exports.ts} +0 -0
- /package/src/packages/contracts/{user-api-keys.ts → src/user-api-keys.ts} +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/client/client.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/client/index.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/client/types.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/client/utils.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/client.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/auth.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/bodySerializer.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/params.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/pathSerializer.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/queryKeySerializer.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/serverSentEvents.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/types.gen.ts +0 -0
- /package/src/packages/sdk-ts/{generated → src/generated}/core/utils.gen.ts +0 -0
- /package/src/packages/sdk-ts/{index.ts → src/index.ts} +0 -0
- /package/src/packages/sdk-ts/{managed-mail-response.ts → src/managed-mail-response.ts} +0 -0
- /package/src/packages/sdk-ts/{managed-mail.ts → src/managed-mail.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{device-flow.ts → src/device-flow.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{index.ts → src/index.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{management-rpc.ts → src/management-rpc.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{organizations.ts → src/organizations.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{parsing.ts → src/parsing.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{session-status.ts → src/session-status.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{tokens.ts → src/tokens.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{user-api-keys.ts → src/user-api-keys.ts} +0 -0
- /package/src/packages/workos-auth-contracts/{webhooks.ts → src/webhooks.ts} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ohmyhost/mcp",
|
|
3
|
+
"version": "0.1.24",
|
|
4
|
+
"private": true,
|
|
5
|
+
"ohmyhost": {
|
|
6
|
+
"deployment": "production",
|
|
7
|
+
"fakeProviderBoundary": {
|
|
8
|
+
"typescriptProject": "tsconfig.build.json",
|
|
9
|
+
"artifactRoot": "dist",
|
|
10
|
+
"entrypoints": [
|
|
11
|
+
"src/index.ts",
|
|
12
|
+
"src/stdio-main.ts",
|
|
13
|
+
"src/worker-main.ts"
|
|
14
|
+
],
|
|
15
|
+
"bundles": []
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"bin": {
|
|
20
|
+
"ohmyhost-mcp": "./dist/stdio-main.js"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"source": "./src/index.ts",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc --project tsconfig.build.json",
|
|
31
|
+
"deploy:dry-run": "wrangler deploy --dry-run --outdir .wrangler/dry-run",
|
|
32
|
+
"test": "vitest run --root ../.. apps/mcp/test",
|
|
33
|
+
"typecheck": "tsc --project tsconfig.json --noEmit"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@ohmyhost/contracts": "workspace:*",
|
|
37
|
+
"@modelcontextprotocol/server": "2.0.0",
|
|
38
|
+
"@ohmyhost/agent-skills": "workspace:*",
|
|
39
|
+
"@ohmyhost/product-cli": "workspace:*",
|
|
40
|
+
"@ohmyhost/sdk-ts": "workspace:*",
|
|
41
|
+
"zod": "4.4.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"wrangler": "4.125.0"
|
|
45
|
+
},
|
|
46
|
+
"license": "Apache-2.0"
|
|
47
|
+
}
|
|
@@ -60,6 +60,8 @@ import {
|
|
|
60
60
|
setProjectCreditBudget,
|
|
61
61
|
createDeployment,
|
|
62
62
|
createProject,
|
|
63
|
+
planProjectDataChange,
|
|
64
|
+
createProjectDataChange,
|
|
63
65
|
submitFeedback,
|
|
64
66
|
getFeedback,
|
|
65
67
|
createOrganization,
|
|
@@ -125,6 +127,7 @@ import {
|
|
|
125
127
|
parsePaidDomain,
|
|
126
128
|
parsePaidDomainPlan,
|
|
127
129
|
parseOperation,
|
|
130
|
+
parseProjectDataChangePlan,
|
|
128
131
|
parseAccountProfile,
|
|
129
132
|
parseCurrentIdentity,
|
|
130
133
|
chooseWorkspace,
|
|
@@ -132,9 +135,11 @@ import {
|
|
|
132
135
|
publicWorkspace,
|
|
133
136
|
selectWorkspace,
|
|
134
137
|
InteractiveSessionRequiredError,
|
|
138
|
+
NativeKeyringProfileRegistry,
|
|
135
139
|
type AuthenticatedProductApiOverrides,
|
|
136
140
|
type EffectiveContext,
|
|
137
141
|
type LocalProfile,
|
|
142
|
+
type ProfileRegistry,
|
|
138
143
|
type WorkspaceSession,
|
|
139
144
|
} from "@ohmyhost/product-cli";
|
|
140
145
|
|
|
@@ -145,6 +150,16 @@ export class OperationEventsUnavailableError extends Error {
|
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
152
|
|
|
153
|
+
/** A saved login whose credential this call read but could not use; it names that login. */
|
|
154
|
+
export class SavedLoginCredentialError extends ProductApiAuthenticationError {
|
|
155
|
+
public constructor(
|
|
156
|
+
code: ProductApiAuthenticationError["code"],
|
|
157
|
+
readonly profile: LocalProfile,
|
|
158
|
+
) {
|
|
159
|
+
super(code);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
148
163
|
/**
|
|
149
164
|
* One client per tool call, for the login that call asked for. The process binding and the call's
|
|
150
165
|
* own arguments choose it, so another agent's choice never changes which account a call uses.
|
|
@@ -153,9 +168,25 @@ export async function createAuthenticatedLocalMcpClient(
|
|
|
153
168
|
signal: AbortSignal,
|
|
154
169
|
overrides: Omit<AuthenticatedProductApiOverrides, "productApiOrigin" | "selector"> = {},
|
|
155
170
|
): Promise<LocalMcpProductClient> {
|
|
171
|
+
const platform = resolveProductCliEnvironment(overrides.environment);
|
|
172
|
+
const registry =
|
|
173
|
+
overrides.profiles ?? new NativeKeyringProfileRegistry(undefined, platform.credentialService);
|
|
174
|
+
// The login whose credential is read is the one a failed renewal concerns.
|
|
175
|
+
let read: LocalProfile | undefined;
|
|
176
|
+
const profiles: ProfileRegistry = {
|
|
177
|
+
list: () => registry.list(),
|
|
178
|
+
credential: (profile) => {
|
|
179
|
+
read = profile;
|
|
180
|
+
return registry.credential(profile);
|
|
181
|
+
},
|
|
182
|
+
save: (profile, credential, replaces) => registry.save(profile, credential, replaces),
|
|
183
|
+
remove: (profile) => registry.remove(profile),
|
|
184
|
+
legacy: () => registry.legacy(),
|
|
185
|
+
};
|
|
156
186
|
try {
|
|
157
187
|
const transport = await createAuthenticatedProductTransport(signal, {
|
|
158
188
|
...overrides,
|
|
189
|
+
profiles,
|
|
159
190
|
selector: "mcp",
|
|
160
191
|
});
|
|
161
192
|
return new GeneratedSdkLocalMcpClient(
|
|
@@ -164,18 +195,12 @@ export async function createAuthenticatedLocalMcpClient(
|
|
|
164
195
|
transport.fetch,
|
|
165
196
|
transport.workspace,
|
|
166
197
|
transport.context,
|
|
167
|
-
|
|
198
|
+
platform.commandPrefix,
|
|
168
199
|
);
|
|
169
200
|
} catch (error) {
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"invalid_environment_token. Supply a valid OHMYHOST_TOKEN or unset it before interactive login.",
|
|
174
|
-
);
|
|
175
|
-
const environment = overrides.environment?.OHMYHOST_ENVIRONMENT ?? "production";
|
|
176
|
-
throw new Error(
|
|
177
|
-
`${error.code}. Run OHMYHOST_ENVIRONMENT=${environment} ohmyhost login and retry.`,
|
|
178
|
-
);
|
|
201
|
+
if (error instanceof ProductApiAuthenticationError && read !== undefined)
|
|
202
|
+
throw new SavedLoginCredentialError(error.code, read);
|
|
203
|
+
throw error;
|
|
179
204
|
}
|
|
180
205
|
}
|
|
181
206
|
|
|
@@ -525,6 +550,8 @@ export class GeneratedSdkLocalMcpClient implements LocalMcpProductClient {
|
|
|
525
550
|
input: Parameters<LocalMcpProductClient["createOrganization"]>[0],
|
|
526
551
|
signal: AbortSignal,
|
|
527
552
|
): Promise<WorkspaceSelectionReport> {
|
|
553
|
+
// A user API token cannot own a new workspace, so it is refused before anything is sent.
|
|
554
|
+
const current = this.#interactiveSession().profile;
|
|
528
555
|
const created = await createOrganization(
|
|
529
556
|
{
|
|
530
557
|
"Idempotency-Key": input.idempotencyKey,
|
|
@@ -535,7 +562,6 @@ export class GeneratedSdkLocalMcpClient implements LocalMcpProductClient {
|
|
|
535
562
|
},
|
|
536
563
|
{ client: this.#client },
|
|
537
564
|
);
|
|
538
|
-
const current = this.#interactiveSession().profile;
|
|
539
565
|
// A login in another organization keeps it, so no other agent using it moves along; the new
|
|
540
566
|
// workspace gets its own login instead.
|
|
541
567
|
if (current.organizationId !== null && current.organizationId !== created.id)
|
|
@@ -833,6 +859,32 @@ export class GeneratedSdkLocalMcpClient implements LocalMcpProductClient {
|
|
|
833
859
|
) as import("@ohmyhost/sdk-ts").FeedbackStatus;
|
|
834
860
|
}
|
|
835
861
|
|
|
862
|
+
public async planProjectDataChange(
|
|
863
|
+
input: Parameters<LocalMcpProductClient["planProjectDataChange"]>[0],
|
|
864
|
+
) {
|
|
865
|
+
return parseProjectDataChangePlan(
|
|
866
|
+
await planProjectDataChange(
|
|
867
|
+
{ project_id: input.projectId, projectDataChangeRequest: { change: input.change } },
|
|
868
|
+
{ client: this.#client },
|
|
869
|
+
),
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
public async createProjectDataChange(
|
|
873
|
+
input: Parameters<LocalMcpProductClient["createProjectDataChange"]>[0],
|
|
874
|
+
): Promise<Operation> {
|
|
875
|
+
return parseOperation(
|
|
876
|
+
await createProjectDataChange(
|
|
877
|
+
{
|
|
878
|
+
project_id: input.projectId,
|
|
879
|
+
projectDataChangeRequest: { change: input.change },
|
|
880
|
+
"If-Match": input.ifMatch,
|
|
881
|
+
"X-Confirmation-Token": input.confirmationToken,
|
|
882
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
883
|
+
},
|
|
884
|
+
{ client: this.#client },
|
|
885
|
+
),
|
|
886
|
+
);
|
|
887
|
+
}
|
|
836
888
|
public createProject(input: Parameters<LocalMcpProductClient["createProject"]>[0]) {
|
|
837
889
|
return createProject(
|
|
838
890
|
{
|
|
@@ -975,7 +1027,12 @@ export class GeneratedSdkLocalMcpClient implements LocalMcpProductClient {
|
|
|
975
1027
|
|
|
976
1028
|
public getDeploymentLogs(input: Parameters<LocalMcpProductClient["getDeploymentLogs"]>[0]) {
|
|
977
1029
|
return getDeploymentLogs(
|
|
978
|
-
{
|
|
1030
|
+
{
|
|
1031
|
+
project_id: input.projectId,
|
|
1032
|
+
deployment_id: input.deploymentId,
|
|
1033
|
+
limit: input.limit,
|
|
1034
|
+
...(input.cursor === undefined ? {} : { cursor: input.cursor }),
|
|
1035
|
+
},
|
|
979
1036
|
{ client: this.#client },
|
|
980
1037
|
);
|
|
981
1038
|
}
|