@r_masseater/msch 0.94.0 → 0.96.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.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/dist/{base-revision-C9RxuIMK.mjs → base-revision-Bl-4nxAd.mjs} +2 -2
  3. package/dist/{base-revision-C9RxuIMK.mjs.map → base-revision-Bl-4nxAd.mjs.map} +1 -1
  4. package/dist/cargo-inputs.mjs +2 -2
  5. package/dist/changed.mjs +5 -5
  6. package/dist/cli.mjs +747 -444
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/config-BBdsNPSO.mjs.map +1 -1
  9. package/dist/config.d.mts +19 -16
  10. package/dist/config.mjs +23 -161
  11. package/dist/config.mjs.map +1 -1
  12. package/dist/decision-rules.d.mts +1 -1
  13. package/dist/decision-rules.mjs +1 -1
  14. package/dist/{define-lint-preset-GWsBHDRn.mjs → define-lint-preset-B-hC9_df.mjs} +91 -57
  15. package/dist/define-lint-preset-B-hC9_df.mjs.map +1 -0
  16. package/dist/exits.mjs +4 -4
  17. package/dist/{ignored-directories-Ce-45yzO.mjs → ignored-directories-D-7Rm_2X.mjs} +2 -2
  18. package/dist/{ignored-directories-Ce-45yzO.mjs.map → ignored-directories-D-7Rm_2X.mjs.map} +1 -1
  19. package/dist/{index-Bw2kfEek.d.mts → index-CEazCJ_w.d.mts} +38 -11
  20. package/dist/{index-CMyIrsah.d.mts → index-Dm0Gg9wS.d.mts} +2 -2
  21. package/dist/judge.mjs +4 -4
  22. package/dist/lint-rules.mjs +23 -11
  23. package/dist/lint-rules.mjs.map +1 -1
  24. package/dist/lint.d.mts +2 -2
  25. package/dist/lint.mjs +1 -1
  26. package/dist/{lookup-report-DVJg0K4Z.mjs → lookup-report-L5OLXRMf.mjs} +3 -3
  27. package/dist/{lookup-report-DVJg0K4Z.mjs.map → lookup-report-L5OLXRMf.mjs.map} +1 -1
  28. package/dist/{manifest-texts-B69vIp7o.mjs → manifest-texts-DPgsV8kj.mjs} +2 -2
  29. package/dist/{manifest-texts-B69vIp7o.mjs.map → manifest-texts-DPgsV8kj.mjs.map} +1 -1
  30. package/dist/{output-B_YPmKad.mjs → output-DAvdel9H.mjs} +3 -3
  31. package/dist/{output-B_YPmKad.mjs.map → output-DAvdel9H.mjs.map} +1 -1
  32. package/dist/oxlint.mjs +2 -2
  33. package/dist/package-routes-BQWX5ttU.mjs +73 -0
  34. package/dist/package-routes-BQWX5ttU.mjs.map +1 -0
  35. package/dist/{package-versions-PMKDR-bJ.mjs → package-versions-sx15IGwA.mjs} +4 -4
  36. package/dist/{package-versions-PMKDR-bJ.mjs.map → package-versions-sx15IGwA.mjs.map} +1 -1
  37. package/dist/{pass-records-CBvMwfN3.mjs → pass-records-BcAAWgiQ.mjs} +4 -4
  38. package/dist/{pass-records-CBvMwfN3.mjs.map → pass-records-BcAAWgiQ.mjs.map} +1 -1
  39. package/dist/{problem-CUIz4TEI.mjs → problem-DbuTeNvL.mjs} +2 -2
  40. package/dist/{problem-CUIz4TEI.mjs.map → problem-DbuTeNvL.mjs.map} +1 -1
  41. package/dist/publish.mjs +23 -87
  42. package/dist/publish.mjs.map +1 -1
  43. package/dist/{published-B5LA4ZlS.mjs → published-3eokcs_D.mjs} +23 -5
  44. package/dist/published-3eokcs_D.mjs.map +1 -0
  45. package/dist/published.mjs +15 -18
  46. package/dist/published.mjs.map +1 -1
  47. package/dist/refs.mjs +6 -7
  48. package/dist/refs.mjs.map +1 -1
  49. package/dist/registries-DePiYd3D.mjs +11 -0
  50. package/dist/registries-DePiYd3D.mjs.map +1 -0
  51. package/dist/{registry-releases-Dj6jH8Yt.mjs → registry-releases-BBtz4wGE.mjs} +3 -3
  52. package/dist/registry-releases-BBtz4wGE.mjs.map +1 -0
  53. package/dist/{repository-files-B6PEvKWe.mjs → repository-files-DSwKJnrj.mjs} +6 -1
  54. package/dist/repository-files-DSwKJnrj.mjs.map +1 -0
  55. package/dist/repository-text-DGfYd5Wq.mjs +178 -0
  56. package/dist/repository-text-DGfYd5Wq.mjs.map +1 -0
  57. package/dist/{runtime-C8OGDSk9.mjs → runtime-Djm7zMwu.mjs} +2 -2
  58. package/dist/{runtime-C8OGDSk9.mjs.map → runtime-Djm7zMwu.mjs.map} +1 -1
  59. package/dist/unbumped.mjs +5 -5
  60. package/dist/{upstream-exits-nTTh2qcD.mjs → upstream-exits-4bn4gblF.mjs} +6 -7
  61. package/dist/{upstream-exits-nTTh2qcD.mjs.map → upstream-exits-4bn4gblF.mjs.map} +1 -1
  62. package/dist/{upstream-record-DlluH3fY.mjs → upstream-record-DRNGym9S.mjs} +2 -2
  63. package/dist/{upstream-record-DlluH3fY.mjs.map → upstream-record-DRNGym9S.mjs.map} +1 -1
  64. package/dist/upstream.mjs +7 -8
  65. package/dist/upstream.mjs.map +1 -1
  66. package/dist/{workspace-projects-B-vCr6bx.mjs → workspace-projects-MpL8K7Nz.mjs} +2 -2
  67. package/dist/{workspace-projects-B-vCr6bx.mjs.map → workspace-projects-MpL8K7Nz.mjs.map} +1 -1
  68. package/dist/workspace-settings.d.mts +1 -1
  69. package/dist/workspace-settings.mjs +50 -31
  70. package/dist/workspace-settings.mjs.map +1 -1
  71. package/package.json +10 -11
  72. package/skills/msch-checks/SKILL.md +3 -3
  73. package/skills/msch-publishing/SKILL.md +4 -4
  74. package/skills/msch-repository-config/SKILL.md +40 -42
  75. package/skills/msch-workspace-settings/SKILL.md +8 -9
  76. package/src/app/vite.d.ts +4 -37
  77. package/dist/credential-broker-PkIpsaMh.mjs +0 -29
  78. package/dist/credential-broker-PkIpsaMh.mjs.map +0 -1
  79. package/dist/define-lint-preset-GWsBHDRn.mjs.map +0 -1
  80. package/dist/owner-settings-BAh-fFKg.mjs +0 -122
  81. package/dist/owner-settings-BAh-fFKg.mjs.map +0 -1
  82. package/dist/package-routes-DQmhjX07.mjs +0 -82
  83. package/dist/package-routes-DQmhjX07.mjs.map +0 -1
  84. package/dist/published-B5LA4ZlS.mjs.map +0 -1
  85. package/dist/registry-releases-Dj6jH8Yt.mjs.map +0 -1
  86. package/dist/repository-files-B6PEvKWe.mjs.map +0 -1
  87. package/dist/wake.d.mts +0 -1
  88. package/dist/wake.mjs +0 -34
  89. package/dist/wake.mjs.map +0 -1
@@ -13,12 +13,14 @@ sources:
13
13
  - src/app/repository-text.ts
14
14
  - src/features/define-lint-preset/index.ts
15
15
  - src/features/build-workspace-settings/index.ts
16
- - src/shared/lib/owner-settings.ts
16
+ - src/shared/lib/repository-origin.ts
17
+ - src/shared/lib/index-skill.ts
18
+ - src/features/check-owner-names/**
17
19
  ---
18
20
 
19
21
  # msch-repository-config
20
22
 
21
- The root `vite.config.ts` builds the whole configuration with `repositoryConfig` from `@r_masseater/msch/config`. It passes only what belongs to the repository. Everything shared by masseater's repositories comes from msch.
23
+ The root `vite.config.ts` builds the whole configuration with `repositoryConfig` from `@r_masseater/msch/config`. It passes only what belongs to the repository. Everything shared by the owner's repositories comes from msch.
22
24
 
23
25
  ## Setup
24
26
 
@@ -39,7 +41,7 @@ The root `vite.config.ts` builds the whole configuration with `repositoryConfig`
39
41
  export default defineConfig({
40
42
  ...repositoryConfig({
41
43
  workspace,
42
- textlint: { kanji: ["個人情報保護法"] },
44
+ textlint: { properNouns: ["個人情報保護法"] },
43
45
  run: { tasks: { "db-check-all": "vp run -r db:check" } },
44
46
  }),
45
47
  msch: { comments: { allow: [] } },
@@ -68,47 +70,43 @@ It records that pass under `node_modules/.cache/msch/overrides`; delete that dir
68
70
  The lint overrides already relax the rules for shadcn/ui components, public entries and deploy entries.
69
71
  They also apply `decisionTestRules` to `*.test.ts`.
70
72
 
73
+ ## Checks cannot be turned off
74
+
75
+ Every check skips generated files, `**/fixtures/**` and `**/upstream/**`, and nothing else.
76
+ Fixtures are the inputs of a checker's tests, and upstream holds code copied from another project.
77
+ No option turns a rule off, lowers it to a warning, changes its preset options or takes a file out.
78
+ The `disabled-rule` check of `msch` resolves `vite.config.ts` and compares it with what `repositoryConfig` builds.
79
+ It reports each difference in lint, textlint, y8, h56m and the msch tasks.
80
+ It also reports each config file that a tool would read from outside `vite.config.ts`.
81
+ The `suppression` check reports each comment that turns a check off, such as `oxlint-disable` or `@ts-expect-error`.
82
+ When a check reports something that is right, fix the code or text. When the check is wrong, fix the check in msch.
83
+
71
84
  ## Options
72
85
 
73
- | Option | Holds |
74
- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
75
- | `workspace` | The result of `workspaceSettings` |
76
- | `overrides` | Extra oxlint overrides for the repository |
77
- | `secrets` | `lines` and `paths` regular expressions that h56m accepts as public. `secretsOf` from `@r_masseater/msch/config` returns the same `h56m` section for a repository that sets only that one |
78
- | `textlint` | `ignores`, `kanji` words allowed past the kanji run limit, `technicalWriting` and `rules` settings, `filters` and `sources` |
79
- | `run` | `tasks`, extra root tasks as `{ name: command }`; and `remoteCache`, the URL of the remote task cache that every `vp run` reads |
80
-
81
- ## Owner settings
82
-
83
- msch checks whose packages a repository publishes and where its packages and agent tools come from. The root `msch` block names them. A key that is left out keeps masseater's value.
84
- Changing a key moves the checks to the new place and keeps them as strict.
85
-
86
- | Key | Holds | Left out |
87
- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
88
- | `packages.scope` | The scope every published package uses. Dependencies in it, or in the scope of any workspace, are looked up in `packages.registry` | `@r_masseater` |
89
- | `packages.registry` | The registry that `msch-publish` publishes to and that msch reads own-scope versions from. Other registries than the public npm one get no provenance or public access, and their READMEs need not be English | `https://registry.npmjs.org/` |
90
- | `installs.registry` | The registry `pnpm-workspace.yaml` must install from. pnpm's default is the public npm registry, so no `registry` line is needed for it | `https://npm.flatt.tech/` (Takumi Guard) |
91
- | `agents.marketplace` | `{ name, repository, plugins }`: the Claude Code marketplace `.claude/settings.json` must know and the plugins it must enable | masseater-dev from masseater/masseater.dev |
92
- | `agents.skills` | `{ repository, root }`: the skill repository the `skills` section must install with `skills: "all"`, or `"marketplace"` when the skills ship as marketplace plugins | masseater/skills |
93
- | `broker` | `{ url, audience }`: the credential broker that takes the GitHub Actions OIDC token, or `false` to use the tokens already in the environment | credentials.masseater.dev |
94
-
95
- This is the block of a repository that publishes privately to GitHub Packages and installs from the default registry.
96
-
97
- ```ts
98
- msch: {
99
- packages: { scope: "@example-org", registry: "https://npm.pkg.github.com" },
100
- installs: { registry: "https://registry.npmjs.org" },
101
- agents: {
102
- marketplace: { name: "example-tools", repository: "example-org/agent-tools", plugins: ["helper"] },
103
- skills: "marketplace",
104
- },
105
- broker: false,
106
- },
107
- ```
108
-
109
- Its publish job sets `registry-url: https://npm.pkg.github.com` in `actions/setup-node`.
110
- The job grants `packages: write` and passes `NODE_AUTH_TOKEN`.
111
- msch reads own-scope versions with `NODE_AUTH_TOKEN`, `GH_TOKEN` or `GITHUB_TOKEN`.
86
+ | Option | Holds |
87
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
88
+ | `workspace` | The result of `workspaceSettings` |
89
+ | `overrides` | Extra oxlint overrides that only add rules: each rule is `"error"`, `"deny"` or `["error", options]`, and options only for a rule the preset does not enable |
90
+ | `textlint` | `properNouns`, names that may break the kanji run limit or end in `!` or `?`; `rules`, rules msch does not set; and `sources`, the files and plugins of non-Markdown text |
91
+ | `markdown` | `docs`, the y8 options that name the headings of AGENTS.md and skills |
92
+ | `run` | `tasks`, extra root tasks as `{ name: command }`; and `remoteCache`, the URL of the remote task cache that every `vp run` reads |
93
+
94
+ ## What msch reads from the repository
95
+
96
+ msch names no owner and has no setting for one. It reads these from the repository it runs in.
97
+
98
+ | Fact | Read from |
99
+ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
100
+ | The owner | `git remote get-url origin`. A source of the `skills` section that the same owner holds must install with `skills: "all"` |
101
+ | The scope of published packages | The scope most published packages of the repository use. A published package outside it is reported |
102
+ | The repository's own plugins | `.claude-plugin/marketplace.json`. When `.claude/settings.json` knows that marketplace from this repository, it enables every plugin |
103
+ | The index skill | The installed skill whose frontmatter has `metadata.role: index`. Only that skill may name other skills |
104
+ | The Renovate presets | The `repository` field of the installed msch and vite-plus-adopt |
105
+
106
+ Packages publish to the public npm registry, and installs go through Takumi Guard (`https://npm.flatt.tech/`).
107
+ `msch-publish` talks to no credential service. It publishes with the `NODE_AUTH_TOKEN` of the job, and tags with `GITHUB_APP_TOKEN` when the job has one.
108
+
109
+ A published package that must work for any owner sets `publish.anyOwner: true` in its `msch` block. The `owner-name` check then reports the owner's name in that package. The full name of the package or of a dependency passes.
112
110
 
113
111
  ## Rule sets
114
112
 
@@ -29,10 +29,9 @@ export default defineConfig({
29
29
  msch: {
30
30
  publish: { installSize: "16.5 MB" },
31
31
  lint: {
32
- ignorePatterns: ["src/generated/**"],
33
32
  overrides: [
34
33
  { files: ["src/**/*.server.ts"], excludeFiles: ["**/*.test.ts"], use: ["traced"] },
35
- { files: ["src/app/cli.ts"], rules: { "node/no-sync": "off" } },
34
+ { files: ["src/app/db/**"], rules: { "msch-lint/db-writes-in-writers": "error" } },
36
35
  ],
37
36
  },
38
37
  devDependencies: {
@@ -45,13 +44,13 @@ export default defineConfig({
45
44
  });
46
45
  ```
47
46
 
48
- | Key | Holds |
49
- | --------------------- | --------------------------------------------------------------------------------------------------------------------------- |
50
- | `lint.ignorePatterns` | Paths in the workspace that oxlint skips |
51
- | `lint.overrides` | Oxlint overrides. `use` names a rule set the root passes to `workspaceSettings` |
52
- | `devDependencies` | Each key states why the workspace needs the packages. `dependencies` lists them, `use` names a dependency set from the root |
53
- | `dependencies` | The same for packages the workspace ships at run time, for a banned package with no other way to do the job |
54
- | `publish.installSize` | The largest install size a published package may reach |
47
+ | Key | Holds |
48
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
49
+ | `lint.overrides` | Oxlint overrides that only add rules. `use` names a rule set the root passes to `workspaceSettings`. A rule set to `"off"`, `"allow"` or `"warn"`, or any other key such as `ignorePatterns`, fails `workspaceSettings`, so every `vp` command fails until it is removed |
50
+ | `devDependencies` | Each key states why the workspace needs the packages. `dependencies` lists them, `use` names a dependency set from the root |
51
+ | `dependencies` | The same for packages the workspace ships at run time, for a banned package with no other way to do the job |
52
+ | `publish.installSize` | The largest install size a published package may reach |
53
+ | `publish.anyOwner` | `true` for a package that must work for any owner. msch then reports the repository owner's name inside it |
55
54
 
56
55
  ## Test and build tasks
57
56
 
package/src/app/vite.d.ts CHANGED
@@ -2,7 +2,6 @@ import type { Fu4Config } from "@r_masseater/fu4";
2
2
  import type { H56mConfig } from "@r_masseater/h56m";
3
3
  import type { WismConfig } from "@r_masseater/wism";
4
4
  import type { Y8Config } from "@r_masseater/y8";
5
- import type { OxlintOverride } from "vite-plus/lint";
6
5
 
7
6
  export type { ToolSections } from "@r_masseater/vite-plus-adopt";
8
7
 
@@ -10,17 +9,19 @@ export type InstallSize = `${number} ${"B" | "kB" | "MB"}`;
10
9
 
11
10
  export interface PublishSettings {
12
11
  readonly installSize: InstallSize;
12
+ readonly anyOwner?: true;
13
13
  }
14
14
 
15
+ export type AddedRule = "error" | "deny" | readonly ["error" | "deny", ...unknown[]];
16
+
15
17
  export interface WorkspaceLintOverride {
16
18
  readonly files: readonly string[];
17
19
  readonly excludeFiles?: readonly string[];
18
- readonly rules?: OxlintOverride["rules"];
20
+ readonly rules?: Readonly<Record<string, AddedRule>>;
19
21
  readonly use?: readonly string[];
20
22
  }
21
23
 
22
24
  export interface WorkspaceLintSettings {
23
- readonly ignorePatterns?: readonly string[];
24
25
  readonly overrides?: readonly WorkspaceLintOverride[];
25
26
  }
26
27
 
@@ -33,41 +34,7 @@ export interface CommentSettings {
33
34
  readonly allow: readonly string[];
34
35
  }
35
36
 
36
- export interface PackageSettings {
37
- readonly scope?: `@${string}`;
38
- readonly registry?: string;
39
- }
40
-
41
- export interface InstallSettings {
42
- readonly registry?: string;
43
- }
44
-
45
- export interface MarketplaceSettings {
46
- readonly name: string;
47
- readonly repository: string;
48
- readonly plugins: readonly string[];
49
- }
50
-
51
- export interface SkillSourceSettings {
52
- readonly repository: string;
53
- readonly root: string;
54
- }
55
-
56
- export interface AgentSettings {
57
- readonly marketplace?: MarketplaceSettings;
58
- readonly skills?: SkillSourceSettings | "marketplace";
59
- }
60
-
61
- export interface BrokerSettings {
62
- readonly url: string;
63
- readonly audience: string;
64
- }
65
-
66
37
  export interface MschConfig {
67
- readonly packages?: PackageSettings;
68
- readonly installs?: InstallSettings;
69
- readonly agents?: AgentSettings;
70
- readonly broker?: BrokerSettings | false;
71
38
  readonly comments?: CommentSettings;
72
39
  readonly publish?: PublishSettings;
73
40
  readonly lint?: WorkspaceLintSettings;
@@ -1,29 +0,0 @@
1
- import { i as ownerSettings } from "./owner-settings-BAh-fFKg.mjs";
2
- import { Config, Effect, Option, Redacted, Schema } from "effect";
3
- import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
4
- import { mask } from "@r_masseater/masseater-utils/github-workflow";
5
- // src/shared/lib/credential-broker.ts
6
- const REPOSITORY_ROOT = ".";
7
- const IdToken = Schema.Struct({ value: Schema.String });
8
- /** @internal */
9
- const oidcToken = Effect.fn("broker.oidc")(function* oidcToken(requestUrl, requestToken, audience) {
10
- const client = yield* HttpClient.HttpClient;
11
- const request = HttpClientRequest.get(`${requestUrl}&audience=${encodeURIComponent(audience)}`).pipe(HttpClientRequest.bearerToken(Redacted.value(requestToken)));
12
- const response = yield* HttpClient.filterStatusOk(client).execute(request);
13
- const { value } = yield* HttpClientResponse.schemaBodyJson(IdToken)(response);
14
- yield* mask(value);
15
- return value;
16
- });
17
- /** @internal */
18
- const actionsOidcToken = Effect.fn("broker.actionsOidc")(function* actionsOidcToken({ audience }) {
19
- const requestUrl = yield* Config.option(Config.String("ACTIONS_ID_TOKEN_REQUEST_URL"));
20
- const requestToken = yield* Config.option(Config.Redacted("ACTIONS_ID_TOKEN_REQUEST_TOKEN"));
21
- if (Option.isNone(requestUrl) || Option.isNone(requestToken)) return Option.none();
22
- const token = yield* oidcToken(requestUrl.value, requestToken.value, audience);
23
- return Option.some(token);
24
- });
25
- /** @internal */
26
- const repositoryBroker = Effect.map(ownerSettings(REPOSITORY_ROOT), ({ broker }) => broker);
27
- export { repositoryBroker as n, actionsOidcToken as t };
28
-
29
- //# sourceMappingURL=credential-broker-PkIpsaMh.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"credential-broker-PkIpsaMh.mjs","names":[],"sources":["../src/shared/lib/credential-broker.ts"],"sourcesContent":["import { mask } from \"@r_masseater/masseater-utils/github-workflow\";\nimport { Config, Effect, Option, Redacted, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { ownerSettings } from \"./owner-settings.ts\";\nimport type { CredentialBroker } from \"./owner-settings.ts\";\n\nconst REPOSITORY_ROOT = \".\";\n\nconst IdToken = Schema.Struct({ value: Schema.String });\n\n/** @internal */\nexport const oidcToken = Effect.fn(\"broker.oidc\")(function* oidcToken(\n requestUrl: string,\n requestToken: Redacted.Redacted,\n audience: string,\n) {\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.get(\n `${requestUrl}&audience=${encodeURIComponent(audience)}`,\n ).pipe(HttpClientRequest.bearerToken(Redacted.value(requestToken)));\n const response = yield* HttpClient.filterStatusOk(client).execute(request);\n const { value } = yield* HttpClientResponse.schemaBodyJson(IdToken)(response);\n yield* mask(value);\n return value;\n});\n\n/** @internal */\nexport const actionsOidcToken = Effect.fn(\"broker.actionsOidc\")(function* actionsOidcToken({\n audience,\n}: CredentialBroker) {\n const requestUrl = yield* Config.option(Config.String(\"ACTIONS_ID_TOKEN_REQUEST_URL\"));\n const requestToken = yield* Config.option(Config.Redacted(\"ACTIONS_ID_TOKEN_REQUEST_TOKEN\"));\n if (Option.isNone(requestUrl) || Option.isNone(requestToken)) {\n return Option.none<string>();\n }\n const token = yield* oidcToken(requestUrl.value, requestToken.value, audience);\n return Option.some(token);\n});\n\n/** @internal */\nexport const repositoryBroker = Effect.map(ownerSettings(REPOSITORY_ROOT), ({ broker }) => broker);\n"],"mappings":";;;;;AAOA,MAAM,kBAAkB;AAExB,MAAM,UAAU,OAAO,OAAO,EAAE,OAAO,OAAO,OAAO,CAAC;;AAGtD,MAAa,YAAY,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,UAC1D,YACA,cACA,UACA;CACA,MAAM,SAAS,OAAO,WAAW;CACjC,MAAM,UAAU,kBAAkB,IAChC,GAAG,WAAW,YAAY,mBAAmB,QAAQ,GACvD,CAAC,CAAC,KAAK,kBAAkB,YAAY,SAAS,MAAM,YAAY,CAAC,CAAC;CAClE,MAAM,WAAW,OAAO,WAAW,eAAe,MAAM,CAAC,CAAC,QAAQ,OAAO;CACzE,MAAM,EAAE,UAAU,OAAO,mBAAmB,eAAe,OAAO,CAAC,CAAC,QAAQ;CAC5E,OAAO,KAAK,KAAK;CACjB,OAAO;AACT,CAAC;;AAGD,MAAa,mBAAmB,OAAO,GAAG,oBAAoB,CAAC,CAAC,UAAU,iBAAiB,EACzF,YACmB;CACnB,MAAM,aAAa,OAAO,OAAO,OAAO,OAAO,OAAO,8BAA8B,CAAC;CACrF,MAAM,eAAe,OAAO,OAAO,OAAO,OAAO,SAAS,gCAAgC,CAAC;CAC3F,IAAI,OAAO,OAAO,UAAU,KAAK,OAAO,OAAO,YAAY,GACzD,OAAO,OAAO,KAAa;CAE7B,MAAM,QAAQ,OAAO,UAAU,WAAW,OAAO,aAAa,OAAO,QAAQ;CAC7E,OAAO,OAAO,KAAK,KAAK;AAC1B,CAAC;;AAGD,MAAa,mBAAmB,OAAO,IAAI,cAAc,eAAe,IAAI,EAAE,aAAa,MAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-lint-preset-GWsBHDRn.mjs","names":["Rec","Arr","Str","effectPresets","decisionPlugin","shadcn","Str","Arr","Rec"],"sources":["../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/decision-rules.ts","../src/features/define-lint-preset/config/web-guidance.config.ts","../src/features/define-lint-preset/config/lint.config.ts","../src/features/define-lint-preset/config/test-rules.config.ts","../src/features/define-lint-preset/config/preset.ts","../src/features/define-lint-preset/config/required-stack.config.ts","../src/features/define-lint-preset/config/traced-rules.config.ts","../src/features/define-lint-preset/config/remotion-rules.config.ts","../src/features/define-lint-preset/config/video-rules.config.ts","../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/features/define-lint-preset/config/markdown.config.ts"],"sourcesContent":["const LOGPUSH = 'Property[key.name=\"logpush\"]:not([value.value=false])';\nconst LOGPUSH_MESSAGE =\n \"Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない\";\n\nconst CPU_LIMIT = 'Property[key.name=\"limits\"]:has(Property[key.name=\"cpuMs\"])';\nconst CPU_LIMIT_MESSAGE =\n \"コードを動かす Worker には limits.cpuMs を付け、本番の CPU 時間の最大値をわずかに上回る値にする。付けないと、1 回の暴走が上限の CPU 時間まで請求される\";\n\nconst UNATTRIBUTED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通し、呼び出し元を metadata に載せる。載せないと、費用やエラーを後から呼び出し元で引けない\";\n\nconst UNGATED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通す。通らない呼び出しには日ごとの費用の上限が掛からず、無料枠を超えた分がそのまま請求される\";\n\nconst MODEL_RUN =\n 'CallExpression[callee.property.name=\"run\"]:matches([callee.object.name=\"AI\"], [callee.object.property.name=\"AI\"])';\n\nconst AI_RUN_URL =\n \":matches(Literal[value=/ai.run/], TemplateLiteral:has(TemplateElement[value.raw=/ai.run/]))\";\n\nconst AI_RUN_REQUEST = `CallExpression:has(> ${AI_RUN_URL})`;\n\nexport const cloudflareResourceSyntax: readonly Readonly<{ selector: string; message: string }>[] =\n [\n {\n selector: `CallExpression[callee.object.name=\"Workers\"][callee.property.name=\"Worker\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=/^(Workers|Website)$/] > ObjectExpression.arguments:has(Property[key.name=\"main\"]):not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"]:not([callee.property.name=\"StaticSite\"]) > ObjectExpression.arguments:not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `${MODEL_RUN}[arguments.length<3]`,\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector: `${MODEL_RUN} > .arguments:nth-child(3):not(Identifier[name=\"options\"])`,\n message: `${UNGATED_MODEL_CALL}。AI.run の第 3 引数には、runWorkersAi の call が受け取る options をそのまま渡す`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments:not(:has(Property[key.name=\"headers\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments > Property[key.name=\"headers\"] > ObjectExpression:not(:has(Property[key.value=\"cf-aig-gateway-id\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector:\n 'CallExpression[callee.name=\"runWorkersAi\"] > ObjectExpression > Property[key.name=\"call\"] > ArrowFunctionExpression[params.length=0]',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.name=\"createAI\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'ObjectExpression:has(Property[key.value=\"cf-aig-gateway-id\"]):not(:has(Property[key.value=\"cf-aig-metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"collectLogs\"][value.value=true]))',\n message:\n \"AI Gateway には collectLogs: true を付ける。付けないと、モデルの呼び出しが後から引けない\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"spendLimits\"] > ObjectExpression > Property[key.name=\"enabled\"][value.value=true]))',\n message:\n \"AI Gateway には spendLimits を enabled: true で付け、日ごとの費用の上限を掛ける。付けないと、従量課金のモデルの呼び出しが上限なく請求される\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"cacheTtl\"]))',\n message:\n \"AI Gateway には cacheTtl を付け、同じ問いの答えをキャッシュする。付けないと、同じ問いにも毎回課金される\",\n },\n {\n selector: 'MemberExpression[object.name=\"Rum\"][property.name=\"Site\"]',\n message:\n \"Rum.Site は使わない。CI のトークンに Account Settings Write が要る。Cloudflare API でホストごとに一度サイトを作り、トークンを CF_BEACON_TOKEN に置く\",\n },\n ];\nexport const removalPolicySyntax: Readonly<{ selector: string; message: string }> = {\n selector:\n 'CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)',\n message:\n \"D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める\",\n};\n\nexport const removalPolicyOverride: {\n files: string[];\n excludeFiles: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/*.ts\"],\n excludeFiles: [\"**/*.test.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax, removalPolicySyntax],\n },\n};\n\nexport const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n removalPolicySyntax,\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nexport const commandsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"bin/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n","import { createDecisionPlugin, defineDecisionRule } from \"@r_masseater/oxlint-plugin-decision\";\n\nexport default createDecisionPlugin({\n name: \"stack\",\n rules: [\n defineDecisionRule({\n id: \"exclusive-status\",\n target: \"file\",\n question:\n \"Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.\",\n message: \"サーバー状態はTanStack Queryだけで扱う。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"ui-state-effect-atom\",\n target: \"file\",\n question:\n \"Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.\",\n message: \"UI状態はeffect-atomだけで扱う。\",\n cutoff: 0.8,\n }),\n ],\n});\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const webGuidanceRules = {\n \"jsx-a11y/no-redundant-roles\": [\"error\", { ul: [\"list\"], ol: [\"list\"] }],\n \"jsx-a11y/no-noninteractive-tabindex\": [\"error\", { tags: [\"section\"], roles: [\"tabpanel\"] }],\n} satisfies LintRules;\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nexport const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \"**/CHANGELOG.md\",\n \".github/release-please/*manifest.json\",\n \"**/.release-please-manifest.json\",\n \"**/*.d.*.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { webGuidanceRules } from \"./web-guidance.config.ts\";\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nconst NO_TEST_DOUBLES =\n \"依存の振る舞いを差し替えない。Effect の Layer を差し替えるか、本物の実装を使う\";\n\nexport const testRules = {\n \"vitest/expect-expect\": [\n \"error\",\n { assertFunctionNames: [\"expect\", \"expect*\", \"assert*\", \"waitFor*\", \"run\", \"*.run\"] },\n ],\n \"vitest/valid-expect\": [\"error\", { maxArgs: 2 }],\n \"vitest/valid-title\": [\"error\", { allowArguments: true }],\n \"vitest/prefer-called-times\": \"off\",\n \"vitest/prefer-import-in-mock\": \"off\",\n \"vitest/no-standalone-expect\": \"off\",\n \"vitest/no-conditional-in-test\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/require-top-level-describe\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/consistent-test-it\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/padding-around-after-all-blocks\": \"off\",\n \"vitest/padding-around-test-blocks\": \"off\",\n \"vitest/max-expects\": \"off\",\n} satisfies LintRules;\n\nconst NO_FLAKE_MASKING =\n \"再試行や flakyTest で不安定なテストを隠さない。待つ対象のイベントを await して直す\";\n\nexport const testDoubleSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=/^(mock|doMock)$/]',\n message: NO_TEST_DOUBLES,\n },\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"stubGlobal\"]',\n message: NO_TEST_DOUBLES,\n },\n];\n\nexport const flakeMaskingSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n { selector: 'Property[key.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"flakyTest\"]', message: NO_FLAKE_MASKING },\n];\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { DECISION_MODEL, DECISION_TIMEOUT_MS } from \"#/shared/config/index.ts\";\n\nimport {\n alchemyOverride,\n cloudflareResourceSyntax,\n removalPolicyOverride,\n commandsOverride,\n} from \"./lint-overrides.config.ts\";\nimport {\n allRulesOf,\n decisionPluginName,\n generated,\n pluginRules,\n shadcnRestyleContracts,\n webGuidanceRules,\n} from \"./lint.config.ts\";\nimport { flakeMaskingSyntax, testDoubleSyntax, testRules } from \"./test-rules.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"@remotion\", specifier: resolved(`${typedRules}/remotion`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/lint-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/capitalized-comments\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n ...testRules,\n ...webGuidanceRules,\n \"msch-lint/array-from-async\": \"error\",\n \"msch-lint/ecosystem-readers\": \"error\",\n \"msch-lint/explicit-import-path\": \"error\",\n \"msch-lint/get-or-insert\": \"error\",\n \"msch-lint/mcp-tool-layer\": \"error\",\n \"msch-lint/main-through-node-main\": \"error\",\n \"msch-lint/inline-exports\": \"error\",\n \"msch-lint/ui-state-in-atoms\": \"error\",\n \"msch-lint/no-hand-written-sql\": \"error\",\n \"msch-lint/platform-node-by-module\": \"error\",\n \"msch-lint/readonly-parameters\": \"error\",\n \"msch-lint/separate-min-max\": \"error\",\n \"msch-lint/typed-calls-not-reflect\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"unicorn/relative-url-style\": [\"error\", \"always\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\", \"stability\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] }],\n \"jsdoc/require-returns\": [\n \"error\",\n { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] },\n ],\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax],\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst overrides = [\n removalPolicyOverride,\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n commandsOverride,\n {\n files: [\"**/bin/**\"],\n rules: { \"baseline-js/use-baseline\": \"off\" },\n },\n {\n files: [\"**/masseater-utils/src/**\"],\n rules: { \"msch-lint/main-through-node-main\": \"off\" },\n },\n {\n files: [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\", \"**/vite.config.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n ...flakeMaskingSyntax,\n ...testDoubleSyntax,\n ],\n },\n },\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"vitest\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPluginName]: {\n model: DECISION_MODEL,\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","const UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"CSV は effect/encoding の Csv だけで読み書きする\": [\n \"papaparse\",\n \"csv-parse\",\n \"csv-parser\",\n \"csv-stringify\",\n \"fast-csv\",\n \"@fast-csv/*\",\n \"d3-dsv\",\n ],\n \"tar は effect/encoding の Tar だけで読み書きする\": [\n \"modern-tar\",\n \"nanotar\",\n \"tar\",\n \"tar-stream\",\n \"tar-fs\",\n \"tar-js\",\n \"tarts\",\n \"it-tar\",\n ],\n \"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる\": [\"skills\"],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n \"テストは Vitest と Playwright だけで扱う\": [\n \"jest\",\n \"jest-*\",\n \"@jest/*\",\n \"ts-jest\",\n \"mocha\",\n \"jasmine\",\n \"jasmine-core\",\n \"ava\",\n \"cypress\",\n \"tap\",\n \"uvu\",\n ],\n \"決済は Stripe だけで扱う\": [\n \"@paypal/*\",\n \"paypal-rest-sdk\",\n \"braintree\",\n \"@paddle/*\",\n \"@lemonsqueezy/*\",\n \"square\",\n ],\n \"整形は Vite+ の vp fmt だけで扱う\": [\n \"prettier\",\n \"prettier-plugin-*\",\n \"@prettier/*\",\n \"@biomejs/*\",\n \"dprint\",\n ],\n \"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む\": [\n \"eslint\",\n \"@eslint/*\",\n \"eslint-config-*\",\n \"tslint\",\n \"standard\",\n \"xo\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n","export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n","import remotion from \"@r_masseater/oxlint-typed-rules/remotion\";\n\nimport { allRulesOf } from \"./lint.config.ts\";\n\nexport const remotionRules = allRulesOf({ prefix: \"@remotion\", rules: remotion.rules });\n","import type { VideoIntro } from \"#/shared/config/index.ts\";\n\nexport interface VideoSayOptions {\n readonly terms?: Readonly<Record<string, string>>;\n readonly banned?: Readonly<Record<string, string>>;\n readonly maxEmphasis?: number;\n}\n\nexport interface VideoSeriesOptions {\n readonly values?: Readonly<Record<string, string>>;\n readonly voices?: readonly string[];\n readonly opener?: string;\n readonly closer?: string;\n readonly intro?: VideoIntro;\n readonly afterIntro?: Readonly<Record<string, string>>;\n}\n\nexport interface VideoRulesOptions {\n readonly say: VideoSayOptions;\n readonly series: Readonly<Record<string, VideoSeriesOptions>>;\n readonly banned?: Readonly<Record<string, string>>;\n}\n\nexport const videoRules = ({ say, series, banned = {} }: VideoRulesOptions) =>\n ({\n \"msch-lint/video-say\": [\"error\", say],\n \"msch-lint/video-readings\": \"error\",\n \"msch-lint/video-series\": [\"error\", { series, banned }],\n }) as const;\n","import type { WismConfig } from \"@r_masseater/wism\";\nimport { rustCrate, skill, structure, workspace } from \"@r_masseater/wism/presets\";\nimport { Array as Arr, Predicate, String as Str, pipe } from \"effect\";\n\nconst NEGATION = \"!\";\nconst isIgnore = Predicate.not(Str.startsWith(NEGATION));\n\nexport interface StructureOptions {\n readonly members: readonly string[];\n readonly ignorePatterns: readonly string[];\n}\n\nexport const structureOf = ({ members, ignorePatterns }: StructureOptions): WismConfig =>\n structure({\n kinds: [workspace({ paths: members }), rustCrate(), skill()],\n ignores: pipe(ignorePatterns, Arr.filter(isIgnore)),\n });\n","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_Y8 = \"@r_masseater/y8/kuromojin\";\n\nexport const requireWithY8Kuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_Y8, { ...context, parentURL: import.meta.url });\n }\n return nextResolve(specifier, context);\n },\n });\n return createRequire(parentUrl);\n};\n","import presetJa from \"@r_masseater/textlint-rule-preset-ja\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, Record as Rec, pipe } from \"effect\";\n\nimport { JAPANESE } from \"#/shared/config/index.ts\";\n\nimport { requireWithY8Kuromojin } from \"./kuromojin.config.ts\";\n\ntype Preset = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]>[string];\ntype Rule = Preset[\"rules\"][string];\ntype Reporter = Extract<Rule, (...args: never) => unknown>;\ntype Fixable = Exclude<Rule, Reporter>;\n\nconst NO_HANDLERS = {};\n\nconst isPreset = (value: unknown): value is Preset =>\n Predicate.hasProperty(value, \"rules\") &&\n Predicate.isObject(value.rules) &&\n Predicate.hasProperty(value, \"rulesConfig\") &&\n Predicate.isObject(value.rulesConfig);\n\nconst presetIn = (value: unknown): Option.Option<Preset> => {\n if (isPreset(value)) {\n return Option.some(value);\n }\n if (Predicate.hasProperty(value, \"default\")) {\n return presetIn(value.default);\n }\n return Option.none();\n};\n\nconst required = requireWithY8Kuromojin(import.meta.url);\n\nconst presetOf = (specifier: string, loaded: unknown): Preset =>\n Option.getOrThrowWith(\n presetIn(loaded),\n () => new TypeError(`${specifier} does not export a textlint preset`),\n );\n\nconst japaneseOnly =\n (reporter: Reporter): Reporter =>\n (context, options) => {\n if (JAPANESE.test(context.getSource())) {\n return reporter(context, options);\n }\n return NO_HANDLERS;\n };\n\nconst forJapanese = (rule: Reporter | Readonly<Fixable>): Rule => {\n if (Predicate.isFunction(rule)) {\n return japaneseOnly(rule);\n }\n return { linter: japaneseOnly(rule.linter), fixer: japaneseOnly(rule.fixer) };\n};\n\nconst japanesePreset = (specifier: string, loaded: unknown): Preset => {\n const { rules, rulesConfig } = presetOf(specifier, loaded);\n return { rules: pipe(rules, Rec.map(forJapanese)), rulesConfig };\n};\n\nexport const textlintPresets: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]> = {\n \"@r_masseater/preset-ja\": japanesePreset(\"@r_masseater/textlint-rule-preset-ja\", presetJa),\n \"@textlint-ja/preset-ai-writing\": japanesePreset(\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n required(\"@textlint-ja/textlint-rule-preset-ai-writing\"),\n ),\n \"preset-ja-technical-writing\": japanesePreset(\n \"textlint-rule-preset-ja-technical-writing\",\n required(\"textlint-rule-preset-ja-technical-writing\"),\n ),\n};\n","import { createRequire } from \"node:module\";\n\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, pipe } from \"effect\";\n\ntype Filter = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]>[string];\n\nconst isFilter = (value: unknown): value is Filter => Predicate.isFunction(value);\n\nconst filterIn = (specifier: string, loaded: unknown): Filter =>\n pipe(\n Option.liftPredicate(loaded, isFilter),\n Option.getOrThrowWith(() => new TypeError(`${specifier} does not export a textlint filter`)),\n );\n\nexport const textlintFilters: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]> =\n {\n comments: filterIn(\n \"textlint-filter-rule-comments\",\n createRequire(import.meta.url)(\"textlint-filter-rule-comments\"),\n ),\n };\n","import type { RuleEntry, Y8Config } from \"@r_masseater/y8\";\nimport { recommended } from \"@r_masseater/y8/presets\";\nimport type { RecommendedOptions } from \"@r_masseater/y8/presets\";\n\nconst INDEX_SKILL = \"masseater-style\";\n\nconst MASSEATER_DOCS: RecommendedOptions = {\n agents: {\n sections: [[\"Tech stack\"], [\"Commands\"], [\"Rules\"]],\n commands: [\"Commands\"],\n stack: [\"Tech stack\"],\n skillNames: { index: INDEX_SKILL },\n },\n skills: { skillNames: { index: INDEX_SKILL } },\n};\n\nconst MARKDOWN_IGNORES = [\n \".agents/skills/**\",\n \"**/fixtures/**\",\n \"**/upstream/**\",\n \"CHANGELOG.md\",\n \"**/CLAUDE.md\",\n];\n\nexport interface MarkdownOptions {\n readonly ignores?: readonly string[];\n readonly rules?: Readonly<Record<string, RuleEntry>>;\n readonly docs?: RecommendedOptions;\n}\n\nexport const markdownOf = ({ ignores = [], rules = {}, docs = {} }: MarkdownOptions): Y8Config => ({\n extends: [\n recommended({\n ...MASSEATER_DOCS,\n ...docs,\n agents: { ...MASSEATER_DOCS.agents, ...docs.agents },\n skills: { ...MASSEATER_DOCS.skills, ...docs.skills },\n }),\n ],\n rules: { \"agnix/XP-001\": \"off\", ...rules },\n reportUnusedDirectives: true,\n ignores: [...MARKDOWN_IGNORES, ...ignores],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,UAAU;AAChB,MAAM,kBACJ;AAEF,MAAM,YAAY;AAClB,MAAM,oBACJ;AAEF,MAAM,0BACJ;AAEF,MAAM,qBACJ;AAEF,MAAM,YACJ;AAKF,MAAM,iBAAiB;AAEvB,MAAa,2BACX;CACE;EACE,UAAU,qHAAqH,QAAQ;EACvI,SAAS;CACX;CACA;EACE,UAAU,sFAAsF,QAAQ;EACxG,SAAS;CACX;CACA;EACE,UAAU,iIAAiI,UAAU;EACrJ,SAAS;CACX;CACA;EACE,UAAU,+HAA+H,UAAU;EACnJ,SAAS;CACX;CACA;EACE,UAAU,GAAG,UAAU;EACvB,SAAS;CACX;CACA;EACE,UAAU,GAAG,UAAU;EACvB,SAAS,GAAG,mBAAmB;CACjC;CACA;EACE,UAAU,GAAG,eAAe;EAC5B,SAAS,GAAG,mBAAmB;CACjC;CACA;EACE,UAAU,GAAG,eAAe;EAC5B,SAAS,GAAG,mBAAmB;CACjC;CACA;EACE,UACE;EACF,SAAS;CACX;CACA;EACE,UACE;EACF,SAAS;CACX;CACA;EACE,UACE;EACF,SAAS;CACX;CACA;EACE,U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AO;IAAC;IAAkB;IAAmB;GAAsB;GACnE,OAAO,EAAE,4BAA4B,MAAM;EAC7C;EACA;EACA;GACE,OAAO,CAAC,WAAW;GACnB,OAAO,EAAE,4BAA4B,MAAM;EAC7C;EACA;GACE,OAAO,CAAC,2BAA2B;GACnC,OAAO,EAAE,oCAAoC,MAAM;EACrD;EACA;GACE,OAAO;IAAC;IAAgB;IAAiB;IAAwB;GAAmB;GACpF,OAAO,EACL,kCAAkC;IAChC;IACA,GAAG;IACH,GAAG;IACH,GAAG;GACL,EACF;EACF;EACA;GACE,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACL,oBAAoB;IACpB,iCAAiC;IACjC,4BAA4B;GAC9B;EACF;CA+BA;CACA,UAAU,GACP,qBAAqB;EACpB,OAAO;EACP,WAAW;EACX,IAAI;CACN,EACF;CACA,SAAS;EACP,WAAW;EACX,WAAW;EACX,cAAc;EACd,+BAA+B;CACjC;AACF;;ACzMA,MAAM,WAAW;AAEjB,MAAa,kBAAkB;AAC/B,MAAM,iBAAiB;AAEvB,MAAa,gBAA6D;EACvE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA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AO,cAAc,QAAQ,QAAQ,GACrC,OAAO,qCAAqB,IAAI,UAAU,GAAG,UAAU,mCAAmC,CAAC,CAC7F;AAEF,MAAa,kBACX,EACE,UAAU,SACR,iCACA,cAAc,YAAY,GAAG,CAAC,CAAC,+BAA+B,CAChE,EACF;;ACjBF,MAAM,cAAc;AAEpB,MAAM,iBAAqC;CACzC,QAAQ;EACN,UAAU;GAAC,CAAC,YAAY;GAAG,CAAC,UAAU;GAAG,CAAC,OAAO;EAAC;EAClD,UAAU,CAAC,UAAU;EACrB,OAAO,CAAC,YAAY;EACpB,YAAY,EAAE,OAAO,YAAY;CACnC;CACA,QAAQ,EAAE,YAAY,EAAE,OAAO,YAAY,EAAE;AAC/C;AAEA,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;AACF;AAQA,MAAa,cAAc,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,SAAoC;CACjG,SAAS,CACP,YAAY;EACV,GAAG;EACH,GAAG;EACH,QAAQ;GAAE,GAAG,eAAe;GAAQ,GAAG,KAAK;EAAO;EACnD,QAAQ;GAAE,GAAG,eAAe;GAAQ,GAAG,KAAK;EAAO;CACrD,CAAC,CACH;CACA,OAAO;EAAE,gBAAgB;EAAO,GAAG;CAAM;CACzC,wBAAwB;CACxB,SAAS,CAAC,GAAG,kBAAkB,GAAG,OAAO;AAC3C"}
@@ -1,122 +0,0 @@
1
- import { r as RepositoryFiles } from "./repository-files-B6PEvKWe.mjs";
2
- import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
3
- import { Array, Effect, Option, Schema, String, pipe } from "effect";
4
- import { resolveConfigFromFile } from "vite-plus";
5
- // src/shared/config/masseater-marketplace.json
6
- var name = "masseater-dev";
7
- var plugins = [{
8
- "name": "kogane",
9
- "source": {
10
- "source": "npm",
11
- "package": "@r_masseater/kogane"
12
- },
13
- "description": "Claude Code plugin that suggests existing workspaces of the current pnpm monorepo for each prompt, ranked with EmbeddingGemma 2 on the user's machine."
14
- }, {
15
- "name": "watashi",
16
- "source": {
17
- "source": "npm",
18
- "package": "@r_masseater/watashi"
19
- },
20
- "description": "CLI for watashi (watashi.masseater.dev). Sends Claude Code transcripts from a Stop hook after masking secrets locally with h56m, and manages login and API tokens."
21
- }];
22
- // src/shared/lib/owner-settings.ts
23
- const CONFIG_FILE = "vite.config.ts";
24
- const TRAILING_SLASH = /\/*$/u;
25
- const SCOPE_SEPARATOR = "/";
26
- const PUBLIC_REGISTRY = "https://registry.npmjs.org/";
27
- const MarketplaceSchema = Schema.Struct({
28
- name: Schema.String,
29
- repository: Schema.String,
30
- plugins: Schema.Array(Schema.String)
31
- });
32
- const SkillSourceSchema = Schema.Struct({
33
- repository: Schema.String,
34
- root: Schema.String
35
- });
36
- const BrokerSchema = Schema.Struct({
37
- url: Schema.String,
38
- audience: Schema.String
39
- });
40
- const OptionalString = Schema.optional(Schema.String);
41
- const PackagesSchema = Schema.Struct({
42
- scope: OptionalString,
43
- registry: OptionalString
44
- });
45
- const InstallsSchema = Schema.Struct({ registry: OptionalString });
46
- const SkillsSchema = Schema.Union([SkillSourceSchema, Schema.Literal("marketplace")]);
47
- const AgentsSchema = Schema.Struct({
48
- marketplace: Schema.optional(MarketplaceSchema),
49
- skills: Schema.optional(SkillsSchema)
50
- });
51
- const BrokerSetting = Schema.Union([BrokerSchema, Schema.Literal(false)]);
52
- const MschSchema = Schema.Struct({
53
- packages: Schema.optional(PackagesSchema),
54
- installs: Schema.optional(InstallsSchema),
55
- agents: Schema.optional(AgentsSchema),
56
- broker: Schema.optional(BrokerSetting)
57
- });
58
- const Configured = Schema.Struct({ msch: MschSchema });
59
- const decodeConfigured = Schema.decodeUnknownOption(Configured);
60
- const withTrailingSlash = (url) => `${String.replace(TRAILING_SLASH, "")(url)}/`;
61
- const scopeOf = (scope) => `${String.replace(TRAILING_SLASH, "")(scope)}${SCOPE_SEPARATOR}`;
62
- const DEFAULT_SETTINGS = {
63
- scope: "@r_masseater/",
64
- publishRegistry: PUBLIC_REGISTRY,
65
- installRegistry: "https://npm.flatt.tech/",
66
- marketplace: {
67
- name,
68
- repository: "masseater/masseater.dev",
69
- plugins: pipe(plugins, Array.map(({ name }) => name))
70
- },
71
- skills: {
72
- repository: "masseater/skills",
73
- root: "plugins/masseater-skills/skills"
74
- },
75
- broker: Option.some({
76
- url: "https://credentials.masseater.dev/",
77
- audience: "masseater-dev-credential-broker"
78
- })
79
- };
80
- const brokerOf = (configured) => {
81
- if (configured === false) return Option.none();
82
- return pipe(Option.fromUndefinedOr(configured), Option.map(({ url, audience }) => ({
83
- url: withTrailingSlash(url),
84
- audience
85
- })), Option.orElse(() => DEFAULT_SETTINGS.broker));
86
- };
87
- const packagesOf = ({ scope, registry }) => ({
88
- scope: Option.match(Option.fromUndefinedOr(scope), {
89
- onNone: () => DEFAULT_SETTINGS.scope,
90
- onSome: scopeOf
91
- }),
92
- publishRegistry: withTrailingSlash(registry ?? DEFAULT_SETTINGS.publishRegistry)
93
- });
94
- const installsOf = ({ registry }) => ({ installRegistry: withTrailingSlash(registry ?? DEFAULT_SETTINGS.installRegistry) });
95
- const agentsOf = ({ marketplace: configured, skills }) => ({
96
- marketplace: configured ?? DEFAULT_SETTINGS.marketplace,
97
- skills: skills ?? DEFAULT_SETTINGS.skills
98
- });
99
- const settingsOf = (config) => pipe(decodeConfigured(config), Option.map(({ msch: { packages = {}, installs = {}, agents = {}, broker } }) => ({
100
- ...packagesOf(packages),
101
- ...installsOf(installs),
102
- ...agentsOf(agents),
103
- broker: brokerOf(broker)
104
- })), Option.getOrElse(() => DEFAULT_SETTINGS));
105
- const resolvedOnce = startedOnce();
106
- const taggedError = Schema.TaggedError;
107
- var OwnerConfigUnreadable = class extends taggedError()("OwnerConfigUnreadable", { file: Schema.String }) {};
108
- const ownerSettings = Effect.fn("ownerSettings")(function* ownerSettings(root) {
109
- const files = yield* RepositoryFiles;
110
- const file = files.join(root, CONFIG_FILE);
111
- if (!(yield* files.exists(file))) return DEFAULT_SETTINGS;
112
- const config = yield* Effect.tryPromise({
113
- try: () => resolvedOnce(file, () => resolveConfigFromFile(file)),
114
- catch: () => OwnerConfigUnreadable.make({ file })
115
- }).pipe(Effect.option);
116
- return pipe(config, Option.map(settingsOf), Option.getOrElse(() => DEFAULT_SETTINGS));
117
- });
118
- const isPublicRegistry = (registry) => withTrailingSlash(registry) === PUBLIC_REGISTRY;
119
- const scopeOfName = (name) => pipe(Option.liftPredicate(name, String.startsWith("@")), Option.flatMap((scoped) => pipe(String.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String.takeLeft(scoped, end + 1)))));
120
- export { scopeOfName as a, ownerSettings as i, PUBLIC_REGISTRY as n, withTrailingSlash as o, isPublicRegistry as r, DEFAULT_SETTINGS as t };
121
-
122
- //# sourceMappingURL=owner-settings-BAh-fFKg.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"owner-settings-BAh-fFKg.mjs","names":["Str","marketplace.name","marketplace.plugins","Arr"],"sources":["../src/shared/config/masseater-marketplace.json","../src/shared/lib/owner-settings.ts"],"sourcesContent":["","import { Array as Arr, Effect, Option, Schema, String as Str, pipe } from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport marketplace from \"#/shared/config/masseater-marketplace.json\" with { type: \"json\" };\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\nimport { startedOnce } from \"./started-once.ts\";\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst TRAILING_SLASH = /\\/*$/u;\nconst SCOPE_SEPARATOR = \"/\";\n\nexport const PUBLIC_REGISTRY = \"https://registry.npmjs.org/\";\n\nconst MarketplaceSchema = Schema.Struct({\n name: Schema.String,\n repository: Schema.String,\n plugins: Schema.Array(Schema.String),\n});\nconst SkillSourceSchema = Schema.Struct({ repository: Schema.String, root: Schema.String });\nconst BrokerSchema = Schema.Struct({ url: Schema.String, audience: Schema.String });\nconst OptionalString = Schema.optional(Schema.String);\nconst PackagesSchema = Schema.Struct({ scope: OptionalString, registry: OptionalString });\nconst InstallsSchema = Schema.Struct({ registry: OptionalString });\nconst SkillsSchema = Schema.Union([SkillSourceSchema, Schema.Literal(\"marketplace\")]);\nconst AgentsSchema = Schema.Struct({\n marketplace: Schema.optional(MarketplaceSchema),\n skills: Schema.optional(SkillsSchema),\n});\nconst BrokerSetting = Schema.Union([BrokerSchema, Schema.Literal(false)]);\nconst MschSchema = Schema.Struct({\n packages: Schema.optional(PackagesSchema),\n installs: Schema.optional(InstallsSchema),\n agents: Schema.optional(AgentsSchema),\n broker: Schema.optional(BrokerSetting),\n});\n\nconst Configured = Schema.Struct({ msch: MschSchema });\nconst decodeConfigured = Schema.decodeUnknownOption(Configured);\n\ntype ConfiguredSettings = (typeof Configured.Type)[\"msch\"];\n\nexport type AgentMarketplace = typeof MarketplaceSchema.Type;\nexport type SkillSource = typeof SkillSourceSchema.Type;\nexport type CredentialBroker = typeof BrokerSchema.Type;\n\nexport interface OwnerSettings {\n readonly scope: string;\n readonly publishRegistry: string;\n readonly installRegistry: string;\n readonly marketplace: AgentMarketplace;\n readonly skills: SkillSource | \"marketplace\";\n readonly broker: Option.Option<CredentialBroker>;\n}\n\nexport const withTrailingSlash = (url: string): string =>\n `${Str.replace(TRAILING_SLASH, \"\")(url)}/`;\n\nconst scopeOf = (scope: string): string =>\n `${Str.replace(TRAILING_SLASH, \"\")(scope)}${SCOPE_SEPARATOR}`;\n\nexport const DEFAULT_SETTINGS: OwnerSettings = {\n scope: \"@r_masseater/\",\n publishRegistry: PUBLIC_REGISTRY,\n installRegistry: \"https://npm.flatt.tech/\",\n marketplace: {\n name: marketplace.name,\n repository: \"masseater/masseater.dev\",\n plugins: pipe(\n marketplace.plugins,\n Arr.map(({ name }) => name),\n ),\n },\n skills: { repository: \"masseater/skills\", root: \"plugins/masseater-skills/skills\" },\n broker: Option.some({\n url: \"https://credentials.masseater.dev/\",\n audience: \"masseater-dev-credential-broker\",\n }),\n};\n\nconst brokerOf = (configured: ConfiguredSettings[\"broker\"]): Option.Option<CredentialBroker> => {\n if (configured === false) {\n return Option.none();\n }\n return pipe(\n Option.fromUndefinedOr(configured),\n Option.map(({ url, audience }) => ({ url: withTrailingSlash(url), audience })),\n Option.orElse(() => DEFAULT_SETTINGS.broker),\n );\n};\n\nconst packagesOf = ({\n scope,\n registry,\n}: NonNullable<ConfiguredSettings[\"packages\"]>): Pick<\n OwnerSettings,\n \"scope\" | \"publishRegistry\"\n> => ({\n scope: Option.match(Option.fromUndefinedOr(scope), {\n onNone: () => DEFAULT_SETTINGS.scope,\n onSome: scopeOf,\n }),\n publishRegistry: withTrailingSlash(registry ?? DEFAULT_SETTINGS.publishRegistry),\n});\n\nconst installsOf = ({\n registry,\n}: NonNullable<ConfiguredSettings[\"installs\"]>): Pick<OwnerSettings, \"installRegistry\"> => ({\n installRegistry: withTrailingSlash(registry ?? DEFAULT_SETTINGS.installRegistry),\n});\n\nconst agentsOf = ({\n marketplace: configured,\n skills,\n}: NonNullable<ConfiguredSettings[\"agents\"]>): Pick<OwnerSettings, \"marketplace\" | \"skills\"> => ({\n marketplace: configured ?? DEFAULT_SETTINGS.marketplace,\n skills: skills ?? DEFAULT_SETTINGS.skills,\n});\n\nexport const settingsOf = (config: unknown): OwnerSettings =>\n pipe(\n decodeConfigured(config),\n Option.map(\n ({ msch: { packages = {}, installs = {}, agents = {}, broker } }): OwnerSettings => ({\n ...packagesOf(packages),\n ...installsOf(installs),\n ...agentsOf(agents),\n broker: brokerOf(broker),\n }),\n ),\n Option.getOrElse(() => DEFAULT_SETTINGS),\n );\n\nconst resolvedOnce = startedOnce<unknown>();\n\nconst taggedError = Schema.TaggedError;\n\nclass OwnerConfigUnreadable extends taggedError<\n OwnerConfigUnreadable,\n { readonly brand: unique symbol }\n>()(\"OwnerConfigUnreadable\", { file: Schema.String }) {}\n\nexport const ownerSettings = Effect.fn(\"ownerSettings\")(function* ownerSettings(root: string) {\n const files = yield* RepositoryFiles;\n const file = files.join(root, CONFIG_FILE);\n const exists = yield* files.exists(file);\n if (!exists) {\n return DEFAULT_SETTINGS;\n }\n const config = yield* Effect.tryPromise({\n try: () => resolvedOnce(file, () => resolveConfigFromFile(file)),\n catch: () => OwnerConfigUnreadable.make({ file }),\n }).pipe(Effect.option);\n return pipe(\n config,\n Option.map(settingsOf),\n Option.getOrElse(() => DEFAULT_SETTINGS),\n );\n});\n\nexport const isPublicRegistry = (registry: string): boolean =>\n withTrailingSlash(registry) === PUBLIC_REGISTRY;\n\nexport const scopeOfName = (name: string): Option.Option<string> =>\n pipe(\n Option.liftPredicate(name, Str.startsWith(\"@\")),\n Option.flatMap((scoped) =>\n pipe(\n Str.indexOf(SCOPE_SEPARATOR)(scoped),\n Option.map((end) => Str.takeLeft(scoped, end + SCOPE_SEPARATOR.length)),\n ),\n ),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;ACQA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AAExB,MAAa,kBAAkB;AAE/B,MAAM,oBAAoB,OAAO,OAAO;CACtC,MAAM,OAAO;CACb,YAAY,OAAO;CACnB,SAAS,OAAO,MAAM,OAAO,MAAM;AACrC,CAAC;AACD,MAAM,oBAAoB,OAAO,OAAO;CAAE,YAAY,OAAO;CAAQ,MAAM,OAAO;AAAO,CAAC;AAC1F,MAAM,eAAe,OAAO,OAAO;CAAE,KAAK,OAAO;CAAQ,UAAU,OAAO;AAAO,CAAC;AAClF,MAAM,iBAAiB,OAAO,SAAS,OAAO,MAAM;AACpD,MAAM,iBAAiB,OAAO,OAAO;CAAE,OAAO;CAAgB,UAAU;AAAe,CAAC;AACxF,MAAM,iBAAiB,OAAO,OAAO,EAAE,UAAU,eAAe,CAAC;AACjE,MAAM,eAAe,OAAO,MAAM,CAAC,mBAAmB,OAAO,QAAQ,aAAa,CAAC,CAAC;AACpF,MAAM,eAAe,OAAO,OAAO;CACjC,aAAa,OAAO,SAAS,iBAAiB;CAC9C,QAAQ,OAAO,SAAS,YAAY;AACtC,CAAC;AACD,MAAM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,OAAI,SAAS,QAAQ,MAAM,CAAsB,CAAC,CACxE,CACF,CACF"}
@@ -1,82 +0,0 @@
1
- import { t as manifestTexts } from "./manifest-texts-B69vIp7o.mjs";
2
- import { a as scopeOfName, i as ownerSettings, n as PUBLIC_REGISTRY, r as isPublicRegistry } from "./owner-settings-BAh-fFKg.mjs";
3
- import { Array, Config, Context, Effect, Option, String, pipe } from "effect";
4
- import { decodePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
5
- import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
6
- // src/shared/lib/lookup.ts
7
- const USER_AGENT = "msch (https://github.com/masseater/ecosystems/tree/main/libs/msch)";
8
- /** @internal */
9
- const JSON_ACCEPT = "application/json";
10
- const requestOf = ({ url, token, accept }) => {
11
- const request = HttpClientRequest.get(url).pipe(HttpClientRequest.setHeader("user-agent", USER_AGENT), HttpClientRequest.setHeader("accept", accept));
12
- return Option.match(token, {
13
- onNone: () => request,
14
- onSome: (value) => HttpClientRequest.bearerToken(value)(request)
15
- });
16
- };
17
- /** @internal */
18
- const sent = (lookup) => HttpClient.HttpClient.pipe(Effect.flatMap((client) => client.execute(requestOf(lookup))));
19
- /** @internal */
20
- const fetched = (lookup) => sent(lookup).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk));
21
- /** @internal */
22
- const jsonLookup = ({ url, token }) => ({
23
- url,
24
- token,
25
- accept: JSON_ACCEPT
26
- });
27
- /** @internal */
28
- const publicLookup = (url) => jsonLookup({
29
- url,
30
- token: Option.none()
31
- });
32
- /** @internal */
33
- const githubToken = Config.option(Config.String("GH_TOKEN").pipe(Config.orElse(() => Config.String("GITHUB_TOKEN")))).pipe(Effect.orElseSucceed(() => Option.none()));
34
- // src/shared/lib/package-routes.ts
35
- /** @internal */
36
- const PUBLIC_ROUTES = {
37
- ownScopes: [],
38
- registry: PUBLIC_REGISTRY,
39
- token: Option.none()
40
- };
41
- const registryToken = (registry) => {
42
- if (isPublicRegistry(registry)) return Effect.succeedNone;
43
- return Config.option(Config.String("NODE_AUTH_TOKEN").pipe(Config.orElse(() => Config.String("GH_TOKEN")), Config.orElse(() => Config.String("GITHUB_TOKEN")))).pipe(Effect.orElseSucceed(() => Option.none()));
44
- };
45
- /** @internal */
46
- const PackageRoutesOf = Context.Reference("msch/PackageRoutesOf", { defaultValue: () => PUBLIC_ROUTES });
47
- /** @internal */
48
- const packageRoutes = Effect.fn("packageRoutes")(function* packageRoutes(root) {
49
- const { scope, publishRegistry } = yield* ownerSettings(root);
50
- const manifests = yield* manifestTexts(root);
51
- const token = yield* registryToken(publishRegistry);
52
- return {
53
- ownScopes: Array.dedupe([scope, ...pipe(manifests, Array.flatMap(({ text }) => pipe(decodePackageJson(text), Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.flatMap(scopeOfName), Option.toArray)))]),
54
- registry: publishRegistry,
55
- token
56
- };
57
- });
58
- /** @internal */
59
- const isOwnPackage = ({ ownScopes }) => (name) => Option.exists(scopeOfName(name), (scope) => Array.contains(ownScopes, scope));
60
- /** @internal */
61
- const packageLookup = (routes) => (name) => {
62
- const path = String.replace("/", "%2f")(name);
63
- if (isOwnPackage(routes)(name)) return jsonLookup({
64
- url: `${routes.registry}${path}`,
65
- token: routes.token
66
- });
67
- return jsonLookup({
68
- url: `${PUBLIC_REGISTRY}${path}`,
69
- token: Option.none()
70
- });
71
- };
72
- const ABBREVIATED = "application/vnd.npm.install-v1+json";
73
- /** @internal */
74
- const abbreviatedLookup = (routes) => (name) => ({
75
- ...packageLookup(routes)(name),
76
- accept: ABBREVIATED
77
- });
78
- /** @internal */
79
- const abbreviatedPackument = (routes) => (name) => sent(abbreviatedLookup(routes)(name));
80
- export { packageLookup as a, githubToken as c, sent as d, isOwnPackage as i, jsonLookup as l, abbreviatedLookup as n, packageRoutes as o, abbreviatedPackument as r, fetched as s, PackageRoutesOf as t, publicLookup as u };
81
-
82
- //# sourceMappingURL=package-routes-DQmhjX07.mjs.map