@mawaru/sdk 0.5.0 → 0.8.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/_schemas/ai-manifest.test.ts +17 -2
- package/_schemas/ai-manifest.ts +9 -9
- package/_schemas/extract-component.test.ts +220 -0
- package/_schemas/extract-component.ts +224 -0
- package/_schemas/graph.test.ts +201 -12
- package/_schemas/graph.ts +99 -10
- package/_schemas/node.ts +3 -0
- package/_schemas/port-spec.test.ts +190 -37
- package/_schemas/port-spec.ts +165 -58
- package/_schemas/program-manifest.ts +9 -8
- package/dist/_schemas/ai-manifest.js +6 -9
- package/dist/_schemas/extract-component.d.ts +35 -0
- package/dist/_schemas/extract-component.js +146 -0
- package/dist/_schemas/graph.d.ts +19 -0
- package/dist/_schemas/graph.js +82 -11
- package/dist/_schemas/node.d.ts +1 -0
- package/dist/_schemas/node.js +3 -0
- package/dist/_schemas/port-spec.d.ts +10 -2
- package/dist/_schemas/port-spec.js +136 -54
- package/dist/_schemas/program-manifest.js +6 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/init.js +3 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/templates/gitignore +4 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { jsonSchemaSchema, portKeySchema } from "./node.js";
|
|
3
|
+
import { manifestInKeysViolation } from "./port-spec.js";
|
|
3
4
|
// nodes/program/<dir>/config.json(リポジトリ規約 v2)。プログラム自身が入出力スキーマを宣言し、
|
|
4
5
|
// エディタが取り込んで ports を自動生成する(実行時の正は ports テーブルのまま。
|
|
5
6
|
// docs/tasks/wip/プログラムのリポジトリ規約v2(ディレクトリ+config.json).md)。
|
|
@@ -22,14 +23,11 @@ export const programManifestSchema = z
|
|
|
22
23
|
refs: z.record(portKeySchema, jsonSchemaSchema).default({}),
|
|
23
24
|
})
|
|
24
25
|
.superRefine((manifest, ctx) => {
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
path: ["inputs"],
|
|
31
|
-
message: 'inputs は "in" の1件だけ宣言してください(join 導入まで)',
|
|
32
|
-
});
|
|
26
|
+
// in の構成は kind が固定する(program は "in" の1口)。ルールの正は
|
|
27
|
+
// port-spec 側で、ここは参照するだけ
|
|
28
|
+
const inViolation = manifestInKeysViolation("program", Object.keys(manifest.inputs));
|
|
29
|
+
if (inViolation) {
|
|
30
|
+
ctx.addIssue({ code: "custom", path: ["inputs"], message: inViolation });
|
|
33
31
|
}
|
|
34
32
|
if (Object.keys(manifest.outputs).length < 1) {
|
|
35
33
|
ctx.addIssue({
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// 正はここ(npm 公開)で、@mawaru/common(private)が re-export して
|
|
3
3
|
// backend / frontend が使う。CLI(typegen / validate)の実装は export しない
|
|
4
4
|
export * from "./_schemas/ai-manifest.js";
|
|
5
|
+
export * from "./_schemas/extract-component.js";
|
|
5
6
|
export * from "./_schemas/graph.js";
|
|
6
7
|
export * from "./_schemas/hook-manifest.js";
|
|
7
8
|
export * from "./_schemas/node.js";
|
package/dist/init.js
CHANGED
|
@@ -64,6 +64,9 @@ export const runInit = (root) => {
|
|
|
64
64
|
}
|
|
65
65
|
writeIfAbsent("CLAUDE.md", template("CLAUDE.md"));
|
|
66
66
|
writeIfAbsent("README.md", template("README.md"));
|
|
67
|
+
// テンプレートのファイル名を .gitignore にすると npm pack 時に無視ルールとして
|
|
68
|
+
// 作用してしまうため、ドット無しの "gitignore" で持つ
|
|
69
|
+
writeIfAbsent(".gitignore", template("gitignore"));
|
|
67
70
|
// package.json:@mawaru/sdk を devDependencies に(ポインタ・docs の参照解決と
|
|
68
71
|
// typegen / validate CLI のため)。バージョンはこのパッケージ自身から取る
|
|
69
72
|
const sdkVersion = JSON.parse(readFileSync(join(packageRoot(), "package.json"), "utf-8")).version;
|
package/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// 正はここ(npm 公開)で、@mawaru/common(private)が re-export して
|
|
3
3
|
// backend / frontend が使う。CLI(typegen / validate)の実装は export しない
|
|
4
4
|
export * from "./_schemas/ai-manifest.js"
|
|
5
|
+
export * from "./_schemas/extract-component.js"
|
|
5
6
|
export * from "./_schemas/graph.js"
|
|
6
7
|
export * from "./_schemas/hook-manifest.js"
|
|
7
8
|
export * from "./_schemas/node.js"
|
package/package.json
CHANGED