@mawaru/sdk 0.18.0 → 0.19.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.
- package/dist/typegen.js +7 -0
- package/package.json +1 -1
package/dist/typegen.js
CHANGED
|
@@ -78,6 +78,13 @@ export const tsTypeFromJsonSchema = (schema, indent = 0) => {
|
|
|
78
78
|
if (typeof schema !== "object" || schema === null || Array.isArray(schema)) {
|
|
79
79
|
return "unknown";
|
|
80
80
|
}
|
|
81
|
+
// file 型(x-mawaru-type マーカー):runner が実行前に参照を実体化し、その位置を
|
|
82
|
+
// ワークスペースのローカルパス(文字列)に置き換えて handler へ渡す/handler は
|
|
83
|
+
// 出力にローカルパスを書く契約なので、参照 object ではなく string を生成する
|
|
84
|
+
// (AI 側の schemaWithFilesAsPath と同じ規約)
|
|
85
|
+
if (schema["x-mawaru-type"] === "file") {
|
|
86
|
+
return "string";
|
|
87
|
+
}
|
|
81
88
|
if ("const" in schema) {
|
|
82
89
|
return literalType(schema.const);
|
|
83
90
|
}
|