@mutagent/sdk 0.2.40 → 0.2.43
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/commonjs/hooks/hooks.d.ts.map +1 -1
- package/dist/commonjs/hooks/hooks.js +0 -2
- package/dist/commonjs/hooks/hooks.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/esm/hooks/hooks.d.ts.map +1 -1
- package/dist/esm/hooks/hooks.js +0 -2
- package/dist/esm/hooks/hooks.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/package.json +15 -2
- package/src/hooks/hooks.ts +0 -3
- package/src/lib/config.ts +2 -2
- package/.changeset/config.json +0 -11
- package/.devcontainer/devcontainer.json +0 -45
- package/examples/package-lock.json +0 -611
- package/examples/package.json +0 -18
- package/examples/userProfileGetProfile.example.ts +0 -28
- package/jsr.json +0 -27
- package/openapi.json +0 -16611
- package/scripts/fix-openapi.ts +0 -1116
- package/scripts/post-generate.ts +0 -99
- package/tsconfig.json +0 -40
package/scripts/post-generate.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Post-generation hook for Speakeasy SDK regeneration.
|
|
4
|
-
*
|
|
5
|
-
* Speakeasy owns most of src/, package.json, and tsconfig.json.
|
|
6
|
-
* On each `speakeasy run`, our manual customizations get wiped.
|
|
7
|
-
* This script idempotently re-applies them:
|
|
8
|
-
*
|
|
9
|
-
* 1. package.json -- ensures ./tracing export in tshy.exports
|
|
10
|
-
* 2. src/index.ts -- appends tracing re-exports (convenience)
|
|
11
|
-
*
|
|
12
|
-
* Run with: bun run scripts/post-generate.ts
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const SDK_ROOT = import.meta.dir + "/..";
|
|
16
|
-
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
// 1. Patch package.json
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
async function patchPackageJson(): Promise<void> {
|
|
22
|
-
const path = `${SDK_ROOT}/package.json`;
|
|
23
|
-
const raw = await Bun.file(path).text();
|
|
24
|
-
const pkg = JSON.parse(raw);
|
|
25
|
-
|
|
26
|
-
// Ensure tshy.exports includes ./tracing
|
|
27
|
-
if (!pkg.tshy) pkg.tshy = {};
|
|
28
|
-
if (!pkg.tshy.exports) pkg.tshy.exports = {};
|
|
29
|
-
if (!pkg.tshy.exports["./tracing"]) {
|
|
30
|
-
pkg.tshy.exports["./tracing"] = "./src/tracing/index.ts";
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
await Bun.write(path, JSON.stringify(pkg, null, 2) + "\n");
|
|
34
|
-
console.log(" package.json: ./tracing export patched");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// ---------------------------------------------------------------------------
|
|
38
|
-
// 2. Append tracing re-exports to src/index.ts
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
|
|
41
|
-
const TRACING_MARKER = "Tracing (auto-appended by post-generation hook";
|
|
42
|
-
|
|
43
|
-
const TRACING_BLOCK = `
|
|
44
|
-
// ---------------------------------------------------------------------------
|
|
45
|
-
// Tracing (auto-appended by post-generation hook -- DO NOT manually edit above)
|
|
46
|
-
// ---------------------------------------------------------------------------
|
|
47
|
-
export {
|
|
48
|
-
initTracing,
|
|
49
|
-
shutdownTracing,
|
|
50
|
-
isTracingInitialized,
|
|
51
|
-
trace,
|
|
52
|
-
withTrace,
|
|
53
|
-
startSpan,
|
|
54
|
-
endSpan,
|
|
55
|
-
getCurrentSpan,
|
|
56
|
-
getCurrentTraceId,
|
|
57
|
-
runInSpanContext,
|
|
58
|
-
} from "./tracing/index.js";
|
|
59
|
-
|
|
60
|
-
export type {
|
|
61
|
-
SpanKind,
|
|
62
|
-
SpanIO,
|
|
63
|
-
SpanStatus,
|
|
64
|
-
SpanEvent,
|
|
65
|
-
SpanMetrics,
|
|
66
|
-
SpanOptions,
|
|
67
|
-
SpanEndOptions,
|
|
68
|
-
SpanHandle,
|
|
69
|
-
MutagentSpan,
|
|
70
|
-
FinishedSpan,
|
|
71
|
-
TracingConfig,
|
|
72
|
-
TracePayload,
|
|
73
|
-
TraceHTTPResponse,
|
|
74
|
-
TraceDecoratorOptions,
|
|
75
|
-
WithTraceOptions,
|
|
76
|
-
} from "./tracing/index.js";
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
async function patchIndexTs(): Promise<void> {
|
|
80
|
-
const path = `${SDK_ROOT}/src/index.ts`;
|
|
81
|
-
const content = await Bun.file(path).text();
|
|
82
|
-
|
|
83
|
-
if (content.includes(TRACING_MARKER)) {
|
|
84
|
-
console.log(" src/index.ts: tracing re-exports already present, skipping");
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
await Bun.write(path, content.trimEnd() + "\n" + TRACING_BLOCK);
|
|
89
|
-
console.log(" src/index.ts: tracing re-exports appended");
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// ---------------------------------------------------------------------------
|
|
93
|
-
// Main
|
|
94
|
-
// ---------------------------------------------------------------------------
|
|
95
|
-
|
|
96
|
-
console.log("Applying post-generation patches...");
|
|
97
|
-
await patchPackageJson();
|
|
98
|
-
await patchIndexTs();
|
|
99
|
-
console.log("Post-generation patches complete.");
|
package/tsconfig.json
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"incremental": false,
|
|
4
|
-
"target": "ES2020",
|
|
5
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
-
"jsx": "react-jsx",
|
|
7
|
-
|
|
8
|
-
"module": "Node16",
|
|
9
|
-
"moduleResolution": "Node16",
|
|
10
|
-
|
|
11
|
-
"allowJs": true,
|
|
12
|
-
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"declarationMap": true,
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"outDir": ".",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json
|
|
20
|
-
"strict": true,
|
|
21
|
-
"allowUnusedLabels": false,
|
|
22
|
-
"allowUnreachableCode": false,
|
|
23
|
-
"exactOptionalPropertyTypes": true,
|
|
24
|
-
"useUnknownInCatchVariables": true,
|
|
25
|
-
"noFallthroughCasesInSwitch": true,
|
|
26
|
-
"noImplicitOverride": true,
|
|
27
|
-
"noImplicitReturns": true,
|
|
28
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
29
|
-
"noUncheckedIndexedAccess": true,
|
|
30
|
-
"noUnusedLocals": true,
|
|
31
|
-
"noUnusedParameters": true,
|
|
32
|
-
"isolatedModules": true,
|
|
33
|
-
"checkJs": true,
|
|
34
|
-
"esModuleInterop": true,
|
|
35
|
-
"skipLibCheck": true,
|
|
36
|
-
"forceConsistentCasingInFileNames": true
|
|
37
|
-
},
|
|
38
|
-
"include": ["src"],
|
|
39
|
-
"exclude": ["node_modules"]
|
|
40
|
-
}
|