@amerged/ohmyhost-mcp 0.1.28 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1419 -0
- package/dist/{chunk-GIP4M4CK.js → chunk-BWVBJWRR.js} +67 -21
- package/dist/index.js +1 -1
- package/dist/stdio-main.js +24152 -2353
- package/package.json +1 -1
- package/src/apps/mcp/package.json +1 -1
- package/src/apps/mcp/src/local-client.ts +12 -2
- package/src/apps/mcp/src/local-server.ts +333 -4
- package/src/apps/product-cli/package.json +4 -2
- package/src/apps/product-cli/src/cli.ts +312 -2
- package/src/apps/product-cli/src/command.ts +261 -0
- package/src/apps/product-cli/src/composition.ts +74 -4
- package/src/apps/product-cli/src/index.ts +6 -0
- package/src/apps/product-cli/src/product-api.ts +5 -0
- package/src/apps/product-cli/src/project-link-store.ts +92 -1
- package/src/apps/product-cli/src/runtime-contract.ts +34 -1
- package/src/apps/product-cli/src/source-managed-client.ts +189 -0
- package/src/apps/product-cli/src/source-publication-store.ts +563 -0
- package/src/apps/product-cli/src/source-publisher.ts +195 -0
- package/src/apps/product-cli/src/source-workspace.ts +552 -0
- package/src/packages/agent-skills/src/generated-skill-resources.ts +18 -8
- package/src/packages/contracts/package.json +10 -0
- package/src/packages/contracts/src/managed-sources.ts +582 -0
- package/src/packages/contracts/src/mcp-source-codec.ts +150 -0
- package/src/packages/contracts/src/operation-failure.ts +22 -6
- package/src/packages/contracts/src/problem-policy.ts +61 -14
- package/src/packages/sdk-ts/package.json +1 -1
- package/src/packages/sdk-ts/src/generated/index.ts +92 -0
- package/src/packages/sdk-ts/src/generated/sdk.gen.ts +541 -0
- package/src/packages/sdk-ts/src/generated/types.gen.ts +911 -4
- package/src/packages/workos-auth-contracts/src/tokens.ts +61 -4
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import {
|
|
2
|
+
changeManagedSource,
|
|
3
|
+
commitManagedSourceUpload,
|
|
4
|
+
createManagedSourceUpload,
|
|
5
|
+
diffManagedSource,
|
|
6
|
+
getManagedSourceUpload,
|
|
7
|
+
getProjectSource,
|
|
8
|
+
initializeManagedSource,
|
|
9
|
+
listManagedSourceFiles,
|
|
10
|
+
listManagedSourceVersions,
|
|
11
|
+
putManagedSourceBlob,
|
|
12
|
+
restoreManagedSource,
|
|
13
|
+
switchManagedSource,
|
|
14
|
+
type OhMyHostClient,
|
|
15
|
+
} from "@ohmyhost/sdk-ts";
|
|
16
|
+
import { assertManagedSourceResponse } from "@ohmyhost/contracts/managed-sources";
|
|
17
|
+
|
|
18
|
+
import type { ManagedSourceApi } from "./source-publisher.js";
|
|
19
|
+
import {
|
|
20
|
+
parseOperation,
|
|
21
|
+
parseProjectSourceBinding,
|
|
22
|
+
ResponseContractError,
|
|
23
|
+
} from "./runtime-contract.js";
|
|
24
|
+
|
|
25
|
+
/** Shared SDK composition for CLI and local MCP; no provider or hand-written REST calls. */
|
|
26
|
+
export class GeneratedSdkManagedSourceApi implements ManagedSourceApi {
|
|
27
|
+
public constructor(private readonly client: () => OhMyHostClient) {}
|
|
28
|
+
|
|
29
|
+
public async getSource(projectId: string) {
|
|
30
|
+
const value = await getProjectSource(
|
|
31
|
+
{ project_id: projectId, include_binding: true },
|
|
32
|
+
{ client: this.client() },
|
|
33
|
+
);
|
|
34
|
+
if (value !== null) parseProjectSourceBinding(value);
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
public async initialize(input: Parameters<ManagedSourceApi["initialize"]>[0]) {
|
|
38
|
+
return parseOperation(
|
|
39
|
+
await initializeManagedSource(
|
|
40
|
+
{
|
|
41
|
+
project_id: input.projectId,
|
|
42
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
43
|
+
managedSourceInitializeRequest: input.body,
|
|
44
|
+
},
|
|
45
|
+
{ client: this.client() },
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
public async files(input: Parameters<ManagedSourceApi["files"]>[0]) {
|
|
50
|
+
const value = await listManagedSourceFiles(
|
|
51
|
+
{
|
|
52
|
+
project_id: input.projectId,
|
|
53
|
+
...(input.commitSha === undefined ? {} : { commit_sha: input.commitSha }),
|
|
54
|
+
...(input.path === undefined ? {} : { path: input.path }),
|
|
55
|
+
},
|
|
56
|
+
{ client: this.client() },
|
|
57
|
+
);
|
|
58
|
+
checkedResponse("files", value);
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
public async versions(input: Parameters<ManagedSourceApi["versions"]>[0]) {
|
|
62
|
+
const value = await listManagedSourceVersions(
|
|
63
|
+
{
|
|
64
|
+
project_id: input.projectId,
|
|
65
|
+
...(input.limit === undefined ? {} : { limit: input.limit }),
|
|
66
|
+
...(input.beforeCommitSha === undefined
|
|
67
|
+
? {}
|
|
68
|
+
: { before_commit_sha: input.beforeCommitSha }),
|
|
69
|
+
},
|
|
70
|
+
{ client: this.client() },
|
|
71
|
+
);
|
|
72
|
+
checkedResponse("versions", value);
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
public async diff(input: Parameters<ManagedSourceApi["diff"]>[0]) {
|
|
76
|
+
const value = await diffManagedSource(
|
|
77
|
+
{
|
|
78
|
+
project_id: input.projectId,
|
|
79
|
+
from_commit_sha: input.fromCommitSha,
|
|
80
|
+
to_commit_sha: input.toCommitSha,
|
|
81
|
+
},
|
|
82
|
+
{ client: this.client() },
|
|
83
|
+
);
|
|
84
|
+
checkedResponse("diff", value);
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
public async changes(input: Parameters<ManagedSourceApi["changes"]>[0]) {
|
|
88
|
+
return parseOperation(
|
|
89
|
+
await changeManagedSource(
|
|
90
|
+
{
|
|
91
|
+
project_id: input.projectId,
|
|
92
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
93
|
+
managedSourceChangesRequest: {
|
|
94
|
+
...input.body,
|
|
95
|
+
changes: input.body.changes.map((change) => ({ ...change })),
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{ client: this.client() },
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
public async restore(input: Parameters<ManagedSourceApi["restore"]>[0]) {
|
|
103
|
+
return parseOperation(
|
|
104
|
+
await restoreManagedSource(
|
|
105
|
+
{
|
|
106
|
+
project_id: input.projectId,
|
|
107
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
108
|
+
managedSourceRestoreRequest: input.body,
|
|
109
|
+
},
|
|
110
|
+
{ client: this.client() },
|
|
111
|
+
),
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
public async createUpload(input: Parameters<ManagedSourceApi["createUpload"]>[0]) {
|
|
115
|
+
return parseOperation(
|
|
116
|
+
await createManagedSourceUpload(
|
|
117
|
+
{
|
|
118
|
+
project_id: input.projectId,
|
|
119
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
120
|
+
managedSourceUploadRequest: input.body,
|
|
121
|
+
},
|
|
122
|
+
{ client: this.client() },
|
|
123
|
+
),
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
public async getUpload(input: Parameters<ManagedSourceApi["getUpload"]>[0]) {
|
|
127
|
+
const value = await getManagedSourceUpload(
|
|
128
|
+
{ project_id: input.projectId, operation_id: input.operationId },
|
|
129
|
+
{ client: this.client() },
|
|
130
|
+
);
|
|
131
|
+
checkedResponse("upload", value);
|
|
132
|
+
return value;
|
|
133
|
+
}
|
|
134
|
+
public async putBlob(input: Parameters<ManagedSourceApi["putBlob"]>[0]) {
|
|
135
|
+
const value = await putManagedSourceBlob(
|
|
136
|
+
{
|
|
137
|
+
project_id: input.projectId,
|
|
138
|
+
operation_id: input.operationId,
|
|
139
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
140
|
+
managedSourceBlobRequest: input.body,
|
|
141
|
+
},
|
|
142
|
+
{ client: this.client() },
|
|
143
|
+
);
|
|
144
|
+
checkedResponse("blob", value);
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
public async commitUpload(input: Parameters<ManagedSourceApi["commitUpload"]>[0]) {
|
|
148
|
+
return parseOperation(
|
|
149
|
+
await commitManagedSourceUpload(
|
|
150
|
+
{
|
|
151
|
+
project_id: input.projectId,
|
|
152
|
+
operation_id: input.operationId,
|
|
153
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
154
|
+
managedSourceFinalizeRequest: {
|
|
155
|
+
...input.body,
|
|
156
|
+
files: input.body.files.map((file) => ({ ...file })),
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{ client: this.client() },
|
|
160
|
+
),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
public async switchSource(input: Parameters<ManagedSourceApi["switchSource"]>[0]) {
|
|
164
|
+
return parseOperation(
|
|
165
|
+
await switchManagedSource(
|
|
166
|
+
{
|
|
167
|
+
project_id: input.projectId,
|
|
168
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
169
|
+
managedSourceSwitchRequest: {
|
|
170
|
+
...input.body,
|
|
171
|
+
files: input.body.files.map((file) => ({ ...file })),
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{ client: this.client() },
|
|
175
|
+
),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function checkedResponse(
|
|
181
|
+
kind: Parameters<typeof assertManagedSourceResponse>[0],
|
|
182
|
+
value: unknown,
|
|
183
|
+
): void {
|
|
184
|
+
try {
|
|
185
|
+
assertManagedSourceResponse(kind, value);
|
|
186
|
+
} catch {
|
|
187
|
+
throw new ResponseContractError();
|
|
188
|
+
}
|
|
189
|
+
}
|