everything-dev 1.20.0 → 1.22.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 (64) hide show
  1. package/dist/cli/init.cjs +163 -80
  2. package/dist/cli/init.cjs.map +1 -1
  3. package/dist/cli/init.d.cts +12 -6
  4. package/dist/cli/init.d.cts.map +1 -1
  5. package/dist/cli/init.d.mts +12 -6
  6. package/dist/cli/init.d.mts.map +1 -1
  7. package/dist/cli/init.mjs +163 -81
  8. package/dist/cli/init.mjs.map +1 -1
  9. package/dist/cli/parse.cjs +9 -0
  10. package/dist/cli/parse.cjs.map +1 -1
  11. package/dist/cli/parse.mjs +9 -0
  12. package/dist/cli/parse.mjs.map +1 -1
  13. package/dist/cli/prompts.cjs +44 -13
  14. package/dist/cli/prompts.cjs.map +1 -1
  15. package/dist/cli/prompts.mjs +44 -13
  16. package/dist/cli/prompts.mjs.map +1 -1
  17. package/dist/cli/sync.cjs +6 -0
  18. package/dist/cli/sync.cjs.map +1 -1
  19. package/dist/cli/sync.mjs +6 -0
  20. package/dist/cli/sync.mjs.map +1 -1
  21. package/dist/cli.cjs +3 -1
  22. package/dist/cli.cjs.map +1 -1
  23. package/dist/cli.mjs +3 -1
  24. package/dist/cli.mjs.map +1 -1
  25. package/dist/contract.cjs +9 -1
  26. package/dist/contract.cjs.map +1 -1
  27. package/dist/contract.d.cts +33 -4
  28. package/dist/contract.d.cts.map +1 -1
  29. package/dist/contract.d.mts +33 -4
  30. package/dist/contract.d.mts.map +1 -1
  31. package/dist/contract.meta.cjs +2 -2
  32. package/dist/contract.meta.cjs.map +1 -1
  33. package/dist/contract.meta.d.cts +3 -3
  34. package/dist/contract.meta.d.mts +3 -3
  35. package/dist/contract.meta.mjs +2 -2
  36. package/dist/contract.meta.mjs.map +1 -1
  37. package/dist/contract.mjs +9 -2
  38. package/dist/contract.mjs.map +1 -1
  39. package/dist/fastkv.cjs +4 -1
  40. package/dist/fastkv.cjs.map +1 -1
  41. package/dist/fastkv.mjs +4 -1
  42. package/dist/fastkv.mjs.map +1 -1
  43. package/dist/index.cjs +1 -0
  44. package/dist/index.d.cts +2 -2
  45. package/dist/index.d.mts +2 -2
  46. package/dist/index.mjs +2 -2
  47. package/dist/plugin.cjs +43 -20
  48. package/dist/plugin.cjs.map +1 -1
  49. package/dist/plugin.d.cts +13 -2
  50. package/dist/plugin.d.cts.map +1 -1
  51. package/dist/plugin.d.mts +13 -2
  52. package/dist/plugin.d.mts.map +1 -1
  53. package/dist/plugin.mjs +44 -21
  54. package/dist/plugin.mjs.map +1 -1
  55. package/package.json +1 -1
  56. package/src/cli/init.ts +252 -95
  57. package/src/cli/parse.ts +17 -0
  58. package/src/cli/prompts.ts +45 -28
  59. package/src/cli/sync.ts +1 -0
  60. package/src/cli.ts +8 -1
  61. package/src/contract.meta.ts +6 -2
  62. package/src/contract.ts +5 -1
  63. package/src/fastkv.ts +6 -1
  64. package/src/plugin.ts +58 -18
@@ -1 +1 @@
1
- {"version":3,"file":"contract.meta.mjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary: \"Publish the current workspace configuration\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"publish\"],\n summary: \"Generate a publish access key\",\n interactive: false,\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: { description: \"Comma-separated plugin keys to include\" },\n withHost: { description: \"Include host/ in template output\" },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n force: { description: \"Overwrite user-modified files\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n force: { description: \"Overwrite user-modified files during sync\" },\n noInstall: { description: \"Skip bun install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,aAAa;EACd;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ,EACN,KAAK,EAAE,aAAa,sCAAsC,EAC3D;EACF;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,QAAQ,EACN,UAAU;GAAE,YAAY;GAAM,aAAa;GAAgC,EAC5E;EACF;CACD,QAAQ;EACN,aAAa,CAAC,SAAS;EACvB,SAAS;EACT,aAAa;EACd;CACD,WAAW;EACT,aAAa,CAAC,UAAU,MAAM;EAC9B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ;IACN,YAAY;IACZ,aAAa;IACd;GACD,IAAI,EAAE,aAAa,gBAAgB;GACnC,YAAY,EAAE,aAAa,2BAA2B;GACvD;EACF;CACD,cAAc;EACZ,aAAa,CAAC,UAAU,SAAS;EACjC,SAAS;EACT,aAAa;EACb,QAAQ,EAAE,KAAK;GAAE,YAAY;GAAM,aAAa;GAAc,EAAE;EACjE;CACD,YAAY;EACV,aAAa,CAAC,UAAU,OAAO;EAC/B,SAAS;EACT,aAAa;EACd;CACD,eAAe;EACb,aAAa,CAAC,UAAU,UAAU;EAClC,SAAS;EACT,aAAa;EACb,QAAQ,EAAE,KAAK;GAAE,YAAY;GAAM,aAAa;GAAc,EAAE;EACjE;CACD,SAAS;EACP,aAAa,CAAC,UAAU;EACxB,SAAS;EACT,aAAa;EACd;CACD,YAAY;EACV,aAAa,CAAC,OAAO,UAAU;EAC/B,SAAS;EACT,aAAa;EACd;CACD,MAAM;EACJ,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ;IACN,YAAY;IACZ,aAAa;IACd;GACD,SAAS,EACP,aAAa,yEACd;GACD,SAAS,EAAE,aAAa,wDAAwD;GAChF,WAAW,EAAE,aAAa,+CAA+C;GACzE,QAAQ,EAAE,aAAa,4CAA4C;GACnE,SAAS,EAAE,aAAa,0CAA0C;GAClE,UAAU,EAAE,aAAa,oCAAoC;GAC7D,eAAe,EAAE,aAAa,gCAAgC;GAC9D,WAAW,EAAE,aAAa,oBAAoB;GAC/C;EACF;CACD,MAAM;EACJ,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,aAAa,yCAAyC;GAChE,OAAO,EAAE,aAAa,iCAAiC;GACvD,WAAW,EAAE,aAAa,oBAAoB;GAC/C;EACF;CACD,SAAS;EACP,aAAa,CAAC,UAAU;EACxB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,aAAa,mCAAmC;GAC1D,OAAO,EAAE,aAAa,6CAA6C;GACnE,WAAW,EAAE,aAAa,oBAAoB;GAC9C,QAAQ,EAAE,aAAa,6CAA6C;GACrE;EACF;CACD,UAAU;EACR,aAAa,CAAC,SAAS,MAAM;EAC7B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,KAAK,EAAE,aAAa,oDAAoD;GACxE,QAAQ,EAAE,aAAa,uDAAuD;GAC/E;EACF;CACD,QAAQ;EACN,aAAa,CAAC,SAAS;EACvB,SAAS;EACT,aAAa;EACd;CACF"}
1
+ {"version":3,"file":"contract.meta.mjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary: \"Publish the current workspace configuration\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"publish\"],\n summary: \"Generate a publish access key\",\n interactive: false,\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to override locally: ui,api,host,plugins\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n force: { description: \"Overwrite user-modified files\" },\n noInstall: { description: \"Skip bun install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n force: { description: \"Overwrite user-modified files during sync\" },\n noInstall: { description: \"Skip bun install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,aAAa;EACd;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ,EACN,KAAK,EAAE,aAAa,sCAAsC,EAC3D;EACF;CACD,OAAO;EACL,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,QAAQ,EACN,UAAU;GAAE,YAAY;GAAM,aAAa;GAAgC,EAC5E;EACF;CACD,QAAQ;EACN,aAAa,CAAC,SAAS;EACvB,SAAS;EACT,aAAa;EACd;CACD,WAAW;EACT,aAAa,CAAC,UAAU,MAAM;E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,EAAE,aAAa,mCAAmC;GAC1D,OAAO,EAAE,aAAa,6CAA6C;GACnE,WAAW,EAAE,aAAa,oBAAoB;GAC9C,QAAQ,EAAE,aAAa,6CAA6C;GACrE;EACF;CACD,UAAU;EACR,aAAa,CAAC,SAAS,MAAM;EAC7B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,KAAK,EAAE,aAAa,oDAAoD;GACxE,QAAQ,EAAE,aAAa,uDAAuD;GAC/E;EACF;CACD,QAAQ;EACN,aAAa,CAAC,SAAS;EACvB,SAAS;EACT,aAAa;EACd;CACF"}
package/dist/contract.mjs CHANGED
@@ -121,6 +121,12 @@ const KeyPublishResultSchema = z.object({
121
121
  privateKey: z.string().optional(),
122
122
  error: z.string().optional()
123
123
  });
124
+ const OverrideSectionSchema = z.enum([
125
+ "ui",
126
+ "api",
127
+ "host",
128
+ "plugins"
129
+ ]);
124
130
  const InitOptionsSchema = z.object({
125
131
  extends: z.string().optional(),
126
132
  directory: z.string().optional(),
@@ -128,7 +134,7 @@ const InitOptionsSchema = z.object({
128
134
  domain: z.string().optional(),
129
135
  source: z.string().optional(),
130
136
  plugins: z.array(z.string()).optional(),
131
- withHost: z.boolean().default(false),
137
+ overrides: z.array(OverrideSectionSchema).optional(),
132
138
  noInteractive: z.boolean().default(false),
133
139
  noInstall: z.boolean().default(false)
134
140
  });
@@ -144,6 +150,7 @@ const InitResultSchema = z.object({
144
150
  domain: z.string().optional(),
145
151
  extends: z.string(),
146
152
  plugins: z.array(z.string()).optional(),
153
+ overrides: z.array(OverrideSectionSchema).optional(),
147
154
  filesCopied: z.number(),
148
155
  timings: z.array(PhaseTimingSchema).optional(),
149
156
  error: z.string().optional()
@@ -285,5 +292,5 @@ const bosContract = oc.router({
285
292
  });
286
293
 
287
294
  //#endregion
288
- export { BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptionsSchema, DevResultSchema, InitOptionsSchema, InitResultSchema, KeyPublishOptionsSchema, KeyPublishResultSchema, PhaseTimingSchema, PluginAddOptionsSchema, PluginAddResultSchema, PluginListResultSchema, PluginPublishOptionsSchema, PluginPublishResultSchema, PluginRemoveOptionsSchema, PluginRemoveResultSchema, PublishOptionsSchema, PublishResultSchema, StartOptionsSchema, StartResultSchema, StatusResultSchema, SyncOptionsSchema, SyncResultSchema, TypesGenOptionsSchema, TypesGenResultSchema, UpgradeOptionsSchema, UpgradeResultSchema, bosContract };
295
+ export { BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptionsSchema, DevResultSchema, InitOptionsSchema, InitResultSchema, KeyPublishOptionsSchema, KeyPublishResultSchema, OverrideSectionSchema, PhaseTimingSchema, PluginAddOptionsSchema, PluginAddResultSchema, PluginListResultSchema, PluginPublishOptionsSchema, PluginPublishResultSchema, PluginRemoveOptionsSchema, PluginRemoveResultSchema, PublishOptionsSchema, PublishResultSchema, StartOptionsSchema, StartResultSchema, StatusResultSchema, SyncOptionsSchema, SyncResultSchema, TypesGenOptionsSchema, TypesGenResultSchema, UpgradeOptionsSchema, UpgradeResultSchema, bosContract };
289
296
  //# sourceMappingURL=contract.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.mjs","names":[],"sources":["../src/contract.ts"],"sourcesContent":["import { oc, z } from \"./sdk\";\nimport { BosConfigSchema, SourceModeSchema } from \"./types\";\n\nexport const DevOptionsSchema = z.object({\n host: SourceModeSchema.default(\"local\"),\n ui: SourceModeSchema.default(\"local\"),\n api: SourceModeSchema.default(\"local\"),\n auth: SourceModeSchema.default(\"local\"),\n proxy: z.boolean().default(false),\n ssr: z.boolean().default(false),\n port: z.number().optional(),\n interactive: z.boolean().optional(),\n});\n\nexport const DevResultSchema = z.object({\n status: z.enum([\"started\", \"error\"]),\n description: z.string(),\n processes: z.array(z.string()),\n});\n\nexport const StartOptionsSchema = z.object({\n port: z.number().optional(),\n interactive: z.boolean().optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n env: z.enum([\"production\", \"staging\"]).default(\"production\"),\n});\n\nexport const StartResultSchema = z.object({\n status: z.enum([\"running\", \"error\"]),\n url: z.string(),\n error: z.string().optional(),\n});\n\nexport const BuildOptionsSchema = z.object({\n packages: z.string().default(\"all\"),\n force: z.boolean().default(false),\n deploy: z.boolean().default(false),\n});\n\nexport const BuildResultSchema = z.object({\n status: z.enum([\"success\", \"error\"]),\n built: z.array(z.string()),\n skipped: z.array(z.string()).optional(),\n deployed: z.boolean().optional(),\n});\n\nexport const ConfigResultSchema = z.object({\n config: BosConfigSchema.nullable(),\n packages: z.array(z.string()),\n remotes: z.array(z.string()),\n});\n\nexport const PluginAddOptionsSchema = z.object({\n source: z.string(),\n as: z.string().optional(),\n production: z.string().optional(),\n});\n\nexport const PluginAddResultSchema = z.object({\n status: z.enum([\"added\", \"error\"]),\n key: z.string(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n version: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const PluginRemoveOptionsSchema = z.object({\n key: z.string(),\n});\n\nexport const PluginRemoveResultSchema = z.object({\n status: z.enum([\"removed\", \"error\"]),\n key: z.string(),\n error: z.string().optional(),\n});\n\nexport const PluginListResultSchema = z.object({\n status: z.enum([\"listed\", \"error\"]),\n plugins: z.array(\n z.object({\n key: z.string(),\n development: z.string().optional(),\n production: z.string().optional(),\n localPath: z.string().optional(),\n source: z.enum([\"local\", \"remote\"]),\n integrity: z.string().optional(),\n version: z.string().optional(),\n name: z.string().optional(),\n }),\n ),\n error: z.string().optional(),\n});\n\nexport const PluginPublishOptionsSchema = z.object({\n key: z.string(),\n});\n\nexport const PluginPublishResultSchema = z.object({\n status: z.enum([\"published\", \"error\"]),\n key: z.string(),\n path: z.string().optional(),\n script: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n version: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const PublishOptionsSchema = z.object({\n deploy: z.boolean().default(false),\n dryRun: z.boolean().default(false),\n packages: z.string().default(\"all\"),\n network: z.enum([\"mainnet\", \"testnet\"]).optional(),\n privateKey: z.string().optional(),\n});\n\nexport const PublishResultSchema = z.object({\n status: z.enum([\"published\", \"error\", \"dry-run\"]),\n registryUrl: z.string(),\n txHash: z.string().optional(),\n error: z.string().optional(),\n built: z.array(z.string()).optional(),\n skipped: z.array(z.string()).optional(),\n});\n\nexport const KeyPublishOptionsSchema = z.object({\n allowance: z.string().default(\"0.25NEAR\"),\n});\n\nexport const KeyPublishResultSchema = z.object({\n status: z.enum([\"published\", \"error\"]),\n account: z.string(),\n network: z.enum([\"mainnet\", \"testnet\"]),\n contract: z.string(),\n allowance: z.string(),\n functionNames: z.array(z.string()),\n publicKey: z.string().optional(),\n privateKey: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const InitOptionsSchema = z.object({\n extends: z.string().optional(),\n directory: z.string().optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n source: z.string().optional(),\n plugins: z.array(z.string()).optional(),\n withHost: z.boolean().default(false),\n noInteractive: z.boolean().default(false),\n noInstall: z.boolean().default(false),\n});\n\nexport const PhaseTimingSchema = z.object({\n name: z.string(),\n durationMs: z.number(),\n});\n\nexport const InitResultSchema = z.object({\n status: z.enum([\"initialized\", \"error\"]),\n directory: z.string(),\n extendsRef: z.string(),\n account: z.string().optional(),\n domain: z.string().optional(),\n extends: z.string(),\n plugins: z.array(z.string()).optional(),\n filesCopied: z.number(),\n timings: z.array(PhaseTimingSchema).optional(),\n error: z.string().optional(),\n});\n\nexport const SyncOptionsSchema = z.object({\n dryRun: z.boolean().default(false),\n force: z.boolean().default(false),\n noInstall: z.boolean().default(false),\n});\n\nexport const SyncResultSchema = z.object({\n status: z.enum([\"synced\", \"dry-run\", \"error\"]),\n updated: z.array(z.string()),\n skipped: z.array(z.string()),\n added: z.array(z.string()),\n error: z.string().optional(),\n});\n\nexport const UpgradeOptionsSchema = z.object({\n dryRun: z.boolean().default(false),\n force: z.boolean().default(false),\n noInstall: z.boolean().default(false),\n noSync: z.boolean().default(false),\n});\n\nexport const UpgradeResultSchema = z.object({\n status: z.enum([\"upgraded\", \"dry-run\", \"error\"]),\n packages: z.array(\n z.object({\n name: z.string(),\n from: z.string().optional(),\n to: z.string(),\n }),\n ),\n sync: SyncResultSchema.optional(),\n migrated: z.array(z.string()).optional(),\n availablePlugins: z.array(z.string()).optional(),\n selectedPlugins: z.array(z.string()).optional(),\n timings: z.array(PhaseTimingSchema).optional(),\n changelogUrl: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const StatusResultSchema = z.object({\n status: z.enum([\"ok\", \"error\"]),\n extends: z.string().optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n packages: z.array(\n z.object({\n name: z.string(),\n installed: z.string().optional(),\n latest: z.string().optional(),\n }),\n ),\n lastSync: z.string().optional(),\n envFile: z.enum([\"found\", \"missing\", \"example-only\"]),\n parentReachable: z.boolean().optional(),\n error: z.string().optional(),\n});\n\nexport const TypesGenOptionsSchema = z.object({\n env: z.enum([\"development\", \"production\"]).optional(),\n dryRun: z.boolean().default(false),\n});\n\nexport const TypesGenResultSchema = z.object({\n status: z.enum([\"success\", \"error\"]),\n generated: z.array(z.string()),\n fetched: z.array(z.string()),\n skipped: z.array(z.string()),\n failed: z.array(z.string()),\n source: z.enum([\"local\", \"remote\"]).optional(),\n error: z.string().optional(),\n});\n\nexport const bosContract = oc.router({\n dev: oc.route({ method: \"POST\", path: \"/dev\" }).input(DevOptionsSchema).output(DevResultSchema),\n start: oc\n .route({ method: \"POST\", path: \"/start\" })\n .input(StartOptionsSchema)\n .output(StartResultSchema),\n build: oc\n .route({ method: \"POST\", path: \"/build\" })\n .input(BuildOptionsSchema)\n .output(BuildResultSchema),\n config: oc.route({ method: \"GET\", path: \"/config\" }).output(ConfigResultSchema),\n pluginAdd: oc\n .route({ method: \"POST\", path: \"/plugin/add\" })\n .input(PluginAddOptionsSchema)\n .output(PluginAddResultSchema),\n pluginRemove: oc\n .route({ method: \"POST\", path: \"/plugin/remove\" })\n .input(PluginRemoveOptionsSchema)\n .output(PluginRemoveResultSchema),\n pluginList: oc.route({ method: \"GET\", path: \"/plugin/list\" }).output(PluginListResultSchema),\n pluginPublish: oc\n .route({ method: \"POST\", path: \"/plugin/publish\" })\n .input(PluginPublishOptionsSchema)\n .output(PluginPublishResultSchema),\n publish: oc\n .route({ method: \"POST\", path: \"/publish\" })\n .input(PublishOptionsSchema)\n .output(PublishResultSchema),\n keyPublish: oc\n .route({ method: \"POST\", path: \"/key/publish\" })\n .input(KeyPublishOptionsSchema)\n .output(KeyPublishResultSchema),\n init: oc\n .route({ method: \"POST\", path: \"/init\" })\n .input(InitOptionsSchema)\n .output(InitResultSchema),\n sync: oc\n .route({ method: \"POST\", path: \"/sync\" })\n .input(SyncOptionsSchema)\n .output(SyncResultSchema),\n upgrade: oc\n .route({ method: \"POST\", path: \"/upgrade\" })\n .input(UpgradeOptionsSchema)\n .output(UpgradeResultSchema),\n status: oc.route({ method: \"GET\", path: \"/status\" }).output(StatusResultSchema),\n typesGen: oc\n .route({ method: \"POST\", path: \"/types/gen\" })\n .input(TypesGenOptionsSchema)\n .output(TypesGenResultSchema),\n});\n\nexport type DevOptions = z.infer<typeof DevOptionsSchema>;\nexport type StartOptions = z.infer<typeof StartOptionsSchema>;\nexport type BuildOptions = z.infer<typeof BuildOptionsSchema>;\nexport type BosConfigResult = z.infer<typeof ConfigResultSchema>;\nexport type PluginAddOptions = z.infer<typeof PluginAddOptionsSchema>;\nexport type PluginAddResult = z.infer<typeof PluginAddResultSchema>;\nexport type PluginRemoveOptions = z.infer<typeof PluginRemoveOptionsSchema>;\nexport type PluginRemoveResult = z.infer<typeof PluginRemoveResultSchema>;\nexport type PluginListResult = z.infer<typeof PluginListResultSchema>;\nexport type PluginPublishOptions = z.infer<typeof PluginPublishOptionsSchema>;\nexport type PluginPublishResult = z.infer<typeof PluginPublishResultSchema>;\nexport type PublishOptions = z.infer<typeof PublishOptionsSchema>;\nexport type KeyPublishOptions = z.infer<typeof KeyPublishOptionsSchema>;\nexport type KeyPublishResult = z.infer<typeof KeyPublishResultSchema>;\nexport type InitOptions = z.infer<typeof InitOptionsSchema>;\nexport type InitResult = z.infer<typeof InitResultSchema>;\nexport type PhaseTiming = z.infer<typeof PhaseTimingSchema>;\nexport type SyncOptions = z.infer<typeof SyncOptionsSchema>;\nexport type SyncResult = z.infer<typeof SyncResultSchema>;\nexport type UpgradeOptions = z.infer<typeof UpgradeOptionsSchema>;\nexport type UpgradeResult = z.infer<typeof UpgradeResultSchema>;\nexport type StatusResult = z.infer<typeof StatusResultSchema>;\nexport type TypesGenOptions = z.infer<typeof TypesGenOptionsSchema>;\nexport type TypesGenResult = z.infer<typeof TypesGenResultSchema>;\n"],"mappings":";;;;AAGA,MAAa,mBAAmB,EAAE,OAAO;CACvC,MAAM,iBAAiB,QAAQ,QAAQ;CACvC,IAAI,iBAAiB,QAAQ,QAAQ;CACrC,KAAK,iBAAiB,QAAQ,QAAQ;CACtC,MAAM,iBAAiB,QAAQ,QAAQ;CACvC,OAAO,EAAE,SAAS,CAAC,QAAQ,MAAM;CACjC,KAAK,EAAE,SAAS,CAAC,QAAQ,MAAM;CAC/B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,aAAa,EAAE,SAAS,CAAC,UAAU;CACpC,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO;CACtC,QAAQ,EAAE,KAAK,CAAC,WAAW,QAAQ,CAAC;CACpC,aAAa,EAAE,QAAQ;CACvB,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC;CAC/B,CAAC;AAEF,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,aAAa,EAAE,SAAS,CAAC,UAAU;CACnC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,KAAK,EAAE,KAAK,CAAC,cAAc,UAAU,CAAC,CAAC,QAAQ,aAAa;CAC7D,CAAC;AAEF,MAAa,oBAAoB,EAAE,OAAO;C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ACpC,SAAS,GACN,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAY,CAAC,CAC3C,MAAM,qBAAqB,CAC3B,OAAO,oBAAoB;CAC9B,YAAY,GACT,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAgB,CAAC,CAC/C,MAAM,wBAAwB,CAC9B,OAAO,uBAAuB;CACjC,MAAM,GACH,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAS,CAAC,CACxC,MAAM,kBAAkB,CACxB,OAAO,iBAAiB;CAC3B,MAAM,GACH,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAS,CAAC,CACxC,MAAM,kBAAkB,CACxB,OAAO,iBAAiB;CAC3B,SAAS,GACN,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAY,CAAC,CAC3C,MAAM,qBAAqB,CAC3B,OAAO,oBAAoB;CAC9B,QAAQ,GAAG,MAAM;EAAE,QAAQ;EAAO,MAAM;EAAW,CAAC,CAAC,OAAO,mBAAmB;CAC/E,UAAU,GACP,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAc,CAAC,CAC7C,MAAM,sBAAsB,CAC5B,OAAO,qBAAqB;CAChC,CAAC"}
1
+ {"version":3,"file":"contract.mjs","names":[],"sources":["../src/contract.ts"],"sourcesContent":["import { oc, z } from \"./sdk\";\nimport { BosConfigSchema, SourceModeSchema } from \"./types\";\n\nexport const DevOptionsSchema = z.object({\n host: SourceModeSchema.default(\"local\"),\n ui: SourceModeSchema.default(\"local\"),\n api: SourceModeSchema.default(\"local\"),\n auth: SourceModeSchema.default(\"local\"),\n proxy: z.boolean().default(false),\n ssr: z.boolean().default(false),\n port: z.number().optional(),\n interactive: z.boolean().optional(),\n});\n\nexport const DevResultSchema = z.object({\n status: z.enum([\"started\", \"error\"]),\n description: z.string(),\n processes: z.array(z.string()),\n});\n\nexport const StartOptionsSchema = z.object({\n port: z.number().optional(),\n interactive: z.boolean().optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n env: z.enum([\"production\", \"staging\"]).default(\"production\"),\n});\n\nexport const StartResultSchema = z.object({\n status: z.enum([\"running\", \"error\"]),\n url: z.string(),\n error: z.string().optional(),\n});\n\nexport const BuildOptionsSchema = z.object({\n packages: z.string().default(\"all\"),\n force: z.boolean().default(false),\n deploy: z.boolean().default(false),\n});\n\nexport const BuildResultSchema = z.object({\n status: z.enum([\"success\", \"error\"]),\n built: z.array(z.string()),\n skipped: z.array(z.string()).optional(),\n deployed: z.boolean().optional(),\n});\n\nexport const ConfigResultSchema = z.object({\n config: BosConfigSchema.nullable(),\n packages: z.array(z.string()),\n remotes: z.array(z.string()),\n});\n\nexport const PluginAddOptionsSchema = z.object({\n source: z.string(),\n as: z.string().optional(),\n production: z.string().optional(),\n});\n\nexport const PluginAddResultSchema = z.object({\n status: z.enum([\"added\", \"error\"]),\n key: z.string(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n version: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const PluginRemoveOptionsSchema = z.object({\n key: z.string(),\n});\n\nexport const PluginRemoveResultSchema = z.object({\n status: z.enum([\"removed\", \"error\"]),\n key: z.string(),\n error: z.string().optional(),\n});\n\nexport const PluginListResultSchema = z.object({\n status: z.enum([\"listed\", \"error\"]),\n plugins: z.array(\n z.object({\n key: z.string(),\n development: z.string().optional(),\n production: z.string().optional(),\n localPath: z.string().optional(),\n source: z.enum([\"local\", \"remote\"]),\n integrity: z.string().optional(),\n version: z.string().optional(),\n name: z.string().optional(),\n }),\n ),\n error: z.string().optional(),\n});\n\nexport const PluginPublishOptionsSchema = z.object({\n key: z.string(),\n});\n\nexport const PluginPublishResultSchema = z.object({\n status: z.enum([\"published\", \"error\"]),\n key: z.string(),\n path: z.string().optional(),\n script: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n version: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const PublishOptionsSchema = z.object({\n deploy: z.boolean().default(false),\n dryRun: z.boolean().default(false),\n packages: z.string().default(\"all\"),\n network: z.enum([\"mainnet\", \"testnet\"]).optional(),\n privateKey: z.string().optional(),\n});\n\nexport const PublishResultSchema = z.object({\n status: z.enum([\"published\", \"error\", \"dry-run\"]),\n registryUrl: z.string(),\n txHash: z.string().optional(),\n error: z.string().optional(),\n built: z.array(z.string()).optional(),\n skipped: z.array(z.string()).optional(),\n});\n\nexport const KeyPublishOptionsSchema = z.object({\n allowance: z.string().default(\"0.25NEAR\"),\n});\n\nexport const KeyPublishResultSchema = z.object({\n status: z.enum([\"published\", \"error\"]),\n account: z.string(),\n network: z.enum([\"mainnet\", \"testnet\"]),\n contract: z.string(),\n allowance: z.string(),\n functionNames: z.array(z.string()),\n publicKey: z.string().optional(),\n privateKey: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const OverrideSectionSchema = z.enum([\"ui\", \"api\", \"host\", \"plugins\"]);\n\nexport const InitOptionsSchema = z.object({\n extends: z.string().optional(),\n directory: z.string().optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n source: z.string().optional(),\n plugins: z.array(z.string()).optional(),\n overrides: z.array(OverrideSectionSchema).optional(),\n noInteractive: z.boolean().default(false),\n noInstall: z.boolean().default(false),\n});\n\nexport const PhaseTimingSchema = z.object({\n name: z.string(),\n durationMs: z.number(),\n});\n\nexport const InitResultSchema = z.object({\n status: z.enum([\"initialized\", \"error\"]),\n directory: z.string(),\n extendsRef: z.string(),\n account: z.string().optional(),\n domain: z.string().optional(),\n extends: z.string(),\n plugins: z.array(z.string()).optional(),\n overrides: z.array(OverrideSectionSchema).optional(),\n filesCopied: z.number(),\n timings: z.array(PhaseTimingSchema).optional(),\n error: z.string().optional(),\n});\n\nexport const SyncOptionsSchema = z.object({\n dryRun: z.boolean().default(false),\n force: z.boolean().default(false),\n noInstall: z.boolean().default(false),\n});\n\nexport const SyncResultSchema = z.object({\n status: z.enum([\"synced\", \"dry-run\", \"error\"]),\n updated: z.array(z.string()),\n skipped: z.array(z.string()),\n added: z.array(z.string()),\n error: z.string().optional(),\n});\n\nexport const UpgradeOptionsSchema = z.object({\n dryRun: z.boolean().default(false),\n force: z.boolean().default(false),\n noInstall: z.boolean().default(false),\n noSync: z.boolean().default(false),\n});\n\nexport const UpgradeResultSchema = z.object({\n status: z.enum([\"upgraded\", \"dry-run\", \"error\"]),\n packages: z.array(\n z.object({\n name: z.string(),\n from: z.string().optional(),\n to: z.string(),\n }),\n ),\n sync: SyncResultSchema.optional(),\n migrated: z.array(z.string()).optional(),\n availablePlugins: z.array(z.string()).optional(),\n selectedPlugins: z.array(z.string()).optional(),\n timings: z.array(PhaseTimingSchema).optional(),\n changelogUrl: z.string().optional(),\n error: z.string().optional(),\n});\n\nexport const StatusResultSchema = z.object({\n status: z.enum([\"ok\", \"error\"]),\n extends: z.string().optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n packages: z.array(\n z.object({\n name: z.string(),\n installed: z.string().optional(),\n latest: z.string().optional(),\n }),\n ),\n lastSync: z.string().optional(),\n envFile: z.enum([\"found\", \"missing\", \"example-only\"]),\n parentReachable: z.boolean().optional(),\n error: z.string().optional(),\n});\n\nexport const TypesGenOptionsSchema = z.object({\n env: z.enum([\"development\", \"production\"]).optional(),\n dryRun: z.boolean().default(false),\n});\n\nexport const TypesGenResultSchema = z.object({\n status: z.enum([\"success\", \"error\"]),\n generated: z.array(z.string()),\n fetched: z.array(z.string()),\n skipped: z.array(z.string()),\n failed: z.array(z.string()),\n source: z.enum([\"local\", \"remote\"]).optional(),\n error: z.string().optional(),\n});\n\nexport const bosContract = oc.router({\n dev: oc.route({ method: \"POST\", path: \"/dev\" }).input(DevOptionsSchema).output(DevResultSchema),\n start: oc\n .route({ method: \"POST\", path: \"/start\" })\n .input(StartOptionsSchema)\n .output(StartResultSchema),\n build: oc\n .route({ method: \"POST\", path: \"/build\" })\n .input(BuildOptionsSchema)\n .output(BuildResultSchema),\n config: oc.route({ method: \"GET\", path: \"/config\" }).output(ConfigResultSchema),\n pluginAdd: oc\n .route({ method: \"POST\", path: \"/plugin/add\" })\n .input(PluginAddOptionsSchema)\n .output(PluginAddResultSchema),\n pluginRemove: oc\n .route({ method: \"POST\", path: \"/plugin/remove\" })\n .input(PluginRemoveOptionsSchema)\n .output(PluginRemoveResultSchema),\n pluginList: oc.route({ method: \"GET\", path: \"/plugin/list\" }).output(PluginListResultSchema),\n pluginPublish: oc\n .route({ method: \"POST\", path: \"/plugin/publish\" })\n .input(PluginPublishOptionsSchema)\n .output(PluginPublishResultSchema),\n publish: oc\n .route({ method: \"POST\", path: \"/publish\" })\n .input(PublishOptionsSchema)\n .output(PublishResultSchema),\n keyPublish: oc\n .route({ method: \"POST\", path: \"/key/publish\" })\n .input(KeyPublishOptionsSchema)\n .output(KeyPublishResultSchema),\n init: oc\n .route({ method: \"POST\", path: \"/init\" })\n .input(InitOptionsSchema)\n .output(InitResultSchema),\n sync: oc\n .route({ method: \"POST\", path: \"/sync\" })\n .input(SyncOptionsSchema)\n .output(SyncResultSchema),\n upgrade: oc\n .route({ method: \"POST\", path: \"/upgrade\" })\n .input(UpgradeOptionsSchema)\n .output(UpgradeResultSchema),\n status: oc.route({ method: \"GET\", path: \"/status\" }).output(StatusResultSchema),\n typesGen: oc\n .route({ method: \"POST\", path: \"/types/gen\" })\n .input(TypesGenOptionsSchema)\n .output(TypesGenResultSchema),\n});\n\nexport type DevOptions = z.infer<typeof DevOptionsSchema>;\nexport type StartOptions = z.infer<typeof StartOptionsSchema>;\nexport type BuildOptions = z.infer<typeof BuildOptionsSchema>;\nexport type BosConfigResult = z.infer<typeof ConfigResultSchema>;\nexport type PluginAddOptions = z.infer<typeof PluginAddOptionsSchema>;\nexport type PluginAddResult = z.infer<typeof PluginAddResultSchema>;\nexport type PluginRemoveOptions = z.infer<typeof PluginRemoveOptionsSchema>;\nexport type PluginRemoveResult = z.infer<typeof PluginRemoveResultSchema>;\nexport type PluginListResult = z.infer<typeof PluginListResultSchema>;\nexport type PluginPublishOptions = z.infer<typeof PluginPublishOptionsSchema>;\nexport type PluginPublishResult = z.infer<typeof PluginPublishResultSchema>;\nexport type PublishOptions = z.infer<typeof PublishOptionsSchema>;\nexport type KeyPublishOptions = z.infer<typeof KeyPublishOptionsSchema>;\nexport type KeyPublishResult = z.infer<typeof KeyPublishResultSchema>;\nexport type InitOptions = z.infer<typeof InitOptionsSchema>;\nexport type InitResult = z.infer<typeof InitResultSchema>;\nexport type OverrideSection = z.infer<typeof OverrideSectionSchema>;\nexport type PhaseTiming = z.infer<typeof PhaseTimingSchema>;\nexport type SyncOptions = z.infer<typeof SyncOptionsSchema>;\nexport type SyncResult = z.infer<typeof SyncResultSchema>;\nexport type UpgradeOptions = z.infer<typeof UpgradeOptionsSchema>;\nexport type UpgradeResult = z.infer<typeof UpgradeResultSchema>;\nexport type StatusResult = z.infer<typeof StatusResultSchema>;\nexport type TypesGenOptions = z.infer<typeof TypesGenOptionsSchema>;\nexport type TypesGenResult = z.infer<typeof TypesGenResultSchema>;\n"],"mappings":";;;;AAGA,MAAa,mBAAmB,EAAE,OAAO;CACvC,MAAM,iBAAiB,QAAQ,QAAQ;CACvC,IAAI,iBAAiB,QAAQ,QAAQ;CACrC,KAAK,iBAAiB,QAAQ,QAAQ;CACtC,MAAM,iBAAiB,QAAQ,QAAQ;CACvC,OAAO,EAAE,SAAS,CAAC,QAAQ,MAAM;CACjC,KAAK,EAAE,SAAS,CAAC,QAAQ,MAAM;CAC/B,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,aAAa,EAAE,SAAS,CAAC,UAAU;CACpC,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO;CACtC,QAAQ,EAAE,KAAK,CAAC,WAAW,QAAQ,CAAC;CACpC,aAAa,EAAE,QAAQ;CACvB,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC;CAC/B,CAAC;AAEF,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,aAAa,EAAE,SAAS,CAAC,UAAU;CACnC,SAAS,EAAE,QA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,cAAc,GACX,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAkB,CAAC,CACjD,MAAM,0BAA0B,CAChC,OAAO,yBAAyB;CACnC,YAAY,GAAG,MAAM;EAAE,QAAQ;EAAO,MAAM;EAAgB,CAAC,CAAC,OAAO,uBAAuB;CAC5F,eAAe,GACZ,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAmB,CAAC,CAClD,MAAM,2BAA2B,CACjC,OAAO,0BAA0B;CACpC,SAAS,GACN,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAY,CAAC,CAC3C,MAAM,qBAAqB,CAC3B,OAAO,oBAAoB;CAC9B,YAAY,GACT,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAgB,CAAC,CAC/C,MAAM,wBAAwB,CAC9B,OAAO,uBAAuB;CACjC,MAAM,GACH,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAS,CAAC,CACxC,MAAM,kBAAkB,CACxB,OAAO,iBAAiB;CAC3B,MAAM,GACH,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAS,CAAC,CACxC,MAAM,kBAAkB,CACxB,OAAO,iBAAiB;CAC3B,SAAS,GACN,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAY,CAAC,CAC3C,MAAM,qBAAqB,CAC3B,OAAO,oBAAoB;CAC9B,QAAQ,GAAG,MAAM;EAAE,QAAQ;EAAO,MAAM;EAAW,CAAC,CAAC,OAAO,mBAAmB;CAC/E,UAAU,GACP,MAAM;EAAE,QAAQ;EAAQ,MAAM;EAAc,CAAC,CAC7C,MAAM,sBAAsB,CAC5B,OAAO,qBAAqB;CAChC,CAAC"}
package/dist/fastkv.cjs CHANGED
@@ -61,8 +61,11 @@ async function fetchBosConfigFromFastKv(bosUrl) {
61
61
  }
62
62
  async function fetchRemotePluginManifest(cdnUrl) {
63
63
  try {
64
+ const controller = new AbortController();
65
+ const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);
64
66
  const baseUrl = cdnUrl.replace(/\/$/, "");
65
- const response = await fetch(`${baseUrl}/plugin.manifest.json`);
67
+ const response = await fetch(`${baseUrl}/plugin.manifest.json`, { signal: controller.signal });
68
+ clearTimeout(timeout);
66
69
  if (!response.ok) return null;
67
70
  return await response.json();
68
71
  } catch {
@@ -1 +1 @@
1
- {"version":3,"file":"fastkv.cjs","names":[],"sources":["../src/fastkv.ts"],"sourcesContent":["export type NetworkId = \"mainnet\" | \"testnet\";\n\ninterface FastKvEntry {\n value: unknown;\n}\n\ninterface FastKvListResponse {\n entries?: Array<FastKvEntry | null>;\n}\n\nconst FASTKV_TIMEOUT_MS = 10_000;\n\nfunction getNetworkIdForAccount(accountId: string): NetworkId {\n return accountId.endsWith(\".testnet\") ? \"testnet\" : \"mainnet\";\n}\n\nexport function getFastKvBaseUrlForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_URL || \"https://kv.test.fastnear.com\"\n : process.env.REGISTRY_FASTKV_MAINNET_URL || \"https://kv.main.fastnear.com\";\n}\n\nfunction getFastKvBaseUrlForAccount(accountId: string): string {\n return getNetworkIdForAccount(accountId) === \"testnet\"\n ? getFastKvBaseUrlForNetwork(\"testnet\")\n : getFastKvBaseUrlForNetwork(\"mainnet\");\n}\n\nexport function buildRegistryConfigUrl(accountId: string, gatewayId: string): string {\n const baseUrl = getFastKvBaseUrlForAccount(accountId);\n const namespace = getRegistryNamespaceForAccount(accountId);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function buildRegistryConfigUrlForNetwork(\n network: NetworkId,\n accountId: string,\n gatewayId: string,\n): string {\n const baseUrl = getFastKvBaseUrlForNetwork(network);\n const namespace = getRegistryNamespaceForNetwork(network);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function getRegistryNamespaceForAccount(accountId: string): string {\n return accountId.endsWith(\".testnet\")\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nexport function getRegistryNamespaceForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nfunction getRegistryConfigKey(\n accountId: string,\n gatewayId: string,\n pathSegments: string[] = [],\n): string {\n const suffix =\n pathSegments.length > 0\n ? `/${pathSegments.map((segment) => encodeURIComponent(segment)).join(\"/\")}`\n : \"\";\n return `apps/${accountId}/${gatewayId}${suffix}/bos.config.json`;\n}\n\nfunction parseBosUrl(bosUrl: string): {\n accountId: string;\n gatewayId: string;\n pathSegments: string[];\n} {\n const match = bosUrl.match(/^bos:\\/\\/([^/]+)\\/(.+)$/);\n if (!match?.[1] || !match[2]) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const pathSegments = match[2]\n .split(\"/\")\n .filter(Boolean)\n .map((segment) => decodeURIComponent(segment));\n if (pathSegments.length === 0) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const [gatewayId, ...pathSegmentsTail] = pathSegments;\n if (!gatewayId) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n return {\n accountId: match[1],\n gatewayId,\n pathSegments: pathSegmentsTail,\n };\n}\n\nexport async function fetchBosConfigFromFastKv<T>(bosUrl: string): Promise<T> {\n const { accountId, gatewayId, pathSegments } = parseBosUrl(bosUrl);\n const payload = await fetchJson<FastKvListResponse>(\n `${getFastKvBaseUrlForAccount(accountId)}/v0/latest/${encodeURIComponent(getRegistryNamespaceForAccount(accountId))}/${encodeURIComponent(accountId)}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n key: getRegistryConfigKey(accountId, gatewayId, pathSegments),\n limit: 1,\n }),\n },\n );\n const value = payload?.entries?.find(Boolean)?.value;\n\n if (!value) {\n throw new Error(`No config found for ${bosUrl}`);\n }\n\n if (typeof value === \"string\") {\n return JSON.parse(value) as T;\n }\n\n if (typeof value !== \"object\") {\n throw new Error(`Invalid config value for ${bosUrl}`);\n }\n\n return value as T;\n}\n\nexport interface PluginManifest {\n schemaVersion: number;\n kind: string;\n plugin: { name: string; version: string };\n runtime: { remoteEntry: string };\n contract: {\n kind: string;\n types: { path: string; exportName: string; typeName: string; sha256: string };\n };\n additionalExports?: Array<{ path: string; exports: string[]; sha256: string }>;\n}\n\nexport async function fetchRemotePluginManifest(cdnUrl: string): Promise<PluginManifest | null> {\n try {\n const baseUrl = cdnUrl.replace(/\\/$/, \"\");\n const response = await fetch(`${baseUrl}/plugin.manifest.json`);\n if (!response.ok) return null;\n return (await response.json()) as PluginManifest;\n } catch {\n return null;\n }\n}\n\nasync function fetchJson<T>(url: string, init?: RequestInit): Promise<T | null> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n ...(init?.headers ?? {}),\n },\n signal: controller.signal,\n });\n\n if (!response.ok) {\n return null;\n }\n\n return (await response.json()) as T;\n } finally {\n clearTimeout(timeout);\n }\n}\n"],"mappings":";;;AAUA,MAAM,oBAAoB;AAE1B,SAAS,uBAAuB,WAA8B;AAC5D,QAAO,UAAU,SAAS,WAAW,GAAG,YAAY;;AAGtD,SAAgB,2BAA2B,SAA4B;AACrE,QAAO,YAAY,YACf,QAAQ,IAAI,+BAA+B,iCAC3C,QAAQ,IAAI,+BAA+B;;AAGjD,SAAS,2BAA2B,WAA2B;AAC7D,QAAO,uBAAuB,UAAU,KAAK,YACzC,2BAA2B,UAAU,GACrC,2BAA2B,UAAU;;A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AAa,QAAQ"}
1
+ {"version":3,"file":"fastkv.cjs","names":[],"sources":["../src/fastkv.ts"],"sourcesContent":["export type NetworkId = \"mainnet\" | \"testnet\";\n\ninterface FastKvEntry {\n value: unknown;\n}\n\ninterface FastKvListResponse {\n entries?: Array<FastKvEntry | null>;\n}\n\nconst FASTKV_TIMEOUT_MS = 10_000;\n\nfunction getNetworkIdForAccount(accountId: string): NetworkId {\n return accountId.endsWith(\".testnet\") ? \"testnet\" : \"mainnet\";\n}\n\nexport function getFastKvBaseUrlForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_URL || \"https://kv.test.fastnear.com\"\n : process.env.REGISTRY_FASTKV_MAINNET_URL || \"https://kv.main.fastnear.com\";\n}\n\nfunction getFastKvBaseUrlForAccount(accountId: string): string {\n return getNetworkIdForAccount(accountId) === \"testnet\"\n ? getFastKvBaseUrlForNetwork(\"testnet\")\n : getFastKvBaseUrlForNetwork(\"mainnet\");\n}\n\nexport function buildRegistryConfigUrl(accountId: string, gatewayId: string): string {\n const baseUrl = getFastKvBaseUrlForAccount(accountId);\n const namespace = getRegistryNamespaceForAccount(accountId);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function buildRegistryConfigUrlForNetwork(\n network: NetworkId,\n accountId: string,\n gatewayId: string,\n): string {\n const baseUrl = getFastKvBaseUrlForNetwork(network);\n const namespace = getRegistryNamespaceForNetwork(network);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function getRegistryNamespaceForAccount(accountId: string): string {\n return accountId.endsWith(\".testnet\")\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nexport function getRegistryNamespaceForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nfunction getRegistryConfigKey(\n accountId: string,\n gatewayId: string,\n pathSegments: string[] = [],\n): string {\n const suffix =\n pathSegments.length > 0\n ? `/${pathSegments.map((segment) => encodeURIComponent(segment)).join(\"/\")}`\n : \"\";\n return `apps/${accountId}/${gatewayId}${suffix}/bos.config.json`;\n}\n\nfunction parseBosUrl(bosUrl: string): {\n accountId: string;\n gatewayId: string;\n pathSegments: string[];\n} {\n const match = bosUrl.match(/^bos:\\/\\/([^/]+)\\/(.+)$/);\n if (!match?.[1] || !match[2]) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const pathSegments = match[2]\n .split(\"/\")\n .filter(Boolean)\n .map((segment) => decodeURIComponent(segment));\n if (pathSegments.length === 0) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const [gatewayId, ...pathSegmentsTail] = pathSegments;\n if (!gatewayId) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n return {\n accountId: match[1],\n gatewayId,\n pathSegments: pathSegmentsTail,\n };\n}\n\nexport async function fetchBosConfigFromFastKv<T>(bosUrl: string): Promise<T> {\n const { accountId, gatewayId, pathSegments } = parseBosUrl(bosUrl);\n const payload = await fetchJson<FastKvListResponse>(\n `${getFastKvBaseUrlForAccount(accountId)}/v0/latest/${encodeURIComponent(getRegistryNamespaceForAccount(accountId))}/${encodeURIComponent(accountId)}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n key: getRegistryConfigKey(accountId, gatewayId, pathSegments),\n limit: 1,\n }),\n },\n );\n const value = payload?.entries?.find(Boolean)?.value;\n\n if (!value) {\n throw new Error(`No config found for ${bosUrl}`);\n }\n\n if (typeof value === \"string\") {\n return JSON.parse(value) as T;\n }\n\n if (typeof value !== \"object\") {\n throw new Error(`Invalid config value for ${bosUrl}`);\n }\n\n return value as T;\n}\n\nexport interface PluginManifest {\n schemaVersion: number;\n kind: string;\n plugin: { name: string; version: string };\n runtime: { remoteEntry: string };\n contract: {\n kind: string;\n types: { path: string; exportName: string; typeName: string; sha256: string };\n };\n additionalExports?: Array<{ path: string; exports: string[]; sha256: string }>;\n}\n\nexport async function fetchRemotePluginManifest(cdnUrl: string): Promise<PluginManifest | null> {\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);\n const baseUrl = cdnUrl.replace(/\\/$/, \"\");\n const response = await fetch(`${baseUrl}/plugin.manifest.json`, {\n signal: controller.signal,\n });\n clearTimeout(timeout);\n if (!response.ok) return null;\n return (await response.json()) as PluginManifest;\n } catch {\n return null;\n }\n}\n\nasync function fetchJson<T>(url: string, init?: RequestInit): Promise<T | null> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n ...(init?.headers ?? {}),\n },\n signal: controller.signal,\n });\n\n if (!response.ok) {\n return null;\n }\n\n return (await response.json()) as T;\n } finally {\n clearTimeout(timeout);\n }\n}\n"],"mappings":";;;AAUA,MAAM,oBAAoB;AAE1B,SAAS,uBAAuB,WAA8B;AAC5D,QAAO,UAAU,SAAS,WAAW,GAAG,YAAY;;AAGtD,SAAgB,2BAA2B,SAA4B;AACrE,QAAO,YAAY,YACf,QAAQ,IAAI,+BAA+B,iCAC3C,QAAQ,IAAI,+BAA+B;;AAGjD,SAAS,2BAA2B,WAA2B;AAC7D,QAAO,uBAAuB,UAAU,KAAK,YACzC,2BAA2B,UAAU,GACrC,2BAA2B,UAAU;;AAG3C,SAAgB,uBAAuB,WAAmB,WAA2B;CACnF,MAAM,UAAU,2BAA2B,UAAU;CACrD,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AAS,GACZ,QAAO;AAGT,SAAQ,MAAM,SAAS,MAAM;WACrB;AACR,eAAa,QAAQ"}
package/dist/fastkv.mjs CHANGED
@@ -59,8 +59,11 @@ async function fetchBosConfigFromFastKv(bosUrl) {
59
59
  }
60
60
  async function fetchRemotePluginManifest(cdnUrl) {
61
61
  try {
62
+ const controller = new AbortController();
63
+ const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);
62
64
  const baseUrl = cdnUrl.replace(/\/$/, "");
63
- const response = await fetch(`${baseUrl}/plugin.manifest.json`);
65
+ const response = await fetch(`${baseUrl}/plugin.manifest.json`, { signal: controller.signal });
66
+ clearTimeout(timeout);
64
67
  if (!response.ok) return null;
65
68
  return await response.json();
66
69
  } catch {
@@ -1 +1 @@
1
- {"version":3,"file":"fastkv.mjs","names":[],"sources":["../src/fastkv.ts"],"sourcesContent":["export type NetworkId = \"mainnet\" | \"testnet\";\n\ninterface FastKvEntry {\n value: unknown;\n}\n\ninterface FastKvListResponse {\n entries?: Array<FastKvEntry | null>;\n}\n\nconst FASTKV_TIMEOUT_MS = 10_000;\n\nfunction getNetworkIdForAccount(accountId: string): NetworkId {\n return accountId.endsWith(\".testnet\") ? \"testnet\" : \"mainnet\";\n}\n\nexport function getFastKvBaseUrlForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_URL || \"https://kv.test.fastnear.com\"\n : process.env.REGISTRY_FASTKV_MAINNET_URL || \"https://kv.main.fastnear.com\";\n}\n\nfunction getFastKvBaseUrlForAccount(accountId: string): string {\n return getNetworkIdForAccount(accountId) === \"testnet\"\n ? getFastKvBaseUrlForNetwork(\"testnet\")\n : getFastKvBaseUrlForNetwork(\"mainnet\");\n}\n\nexport function buildRegistryConfigUrl(accountId: string, gatewayId: string): string {\n const baseUrl = getFastKvBaseUrlForAccount(accountId);\n const namespace = getRegistryNamespaceForAccount(accountId);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function buildRegistryConfigUrlForNetwork(\n network: NetworkId,\n accountId: string,\n gatewayId: string,\n): string {\n const baseUrl = getFastKvBaseUrlForNetwork(network);\n const namespace = getRegistryNamespaceForNetwork(network);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function getRegistryNamespaceForAccount(accountId: string): string {\n return accountId.endsWith(\".testnet\")\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nexport function getRegistryNamespaceForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nfunction getRegistryConfigKey(\n accountId: string,\n gatewayId: string,\n pathSegments: string[] = [],\n): string {\n const suffix =\n pathSegments.length > 0\n ? `/${pathSegments.map((segment) => encodeURIComponent(segment)).join(\"/\")}`\n : \"\";\n return `apps/${accountId}/${gatewayId}${suffix}/bos.config.json`;\n}\n\nfunction parseBosUrl(bosUrl: string): {\n accountId: string;\n gatewayId: string;\n pathSegments: string[];\n} {\n const match = bosUrl.match(/^bos:\\/\\/([^/]+)\\/(.+)$/);\n if (!match?.[1] || !match[2]) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const pathSegments = match[2]\n .split(\"/\")\n .filter(Boolean)\n .map((segment) => decodeURIComponent(segment));\n if (pathSegments.length === 0) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const [gatewayId, ...pathSegmentsTail] = pathSegments;\n if (!gatewayId) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n return {\n accountId: match[1],\n gatewayId,\n pathSegments: pathSegmentsTail,\n };\n}\n\nexport async function fetchBosConfigFromFastKv<T>(bosUrl: string): Promise<T> {\n const { accountId, gatewayId, pathSegments } = parseBosUrl(bosUrl);\n const payload = await fetchJson<FastKvListResponse>(\n `${getFastKvBaseUrlForAccount(accountId)}/v0/latest/${encodeURIComponent(getRegistryNamespaceForAccount(accountId))}/${encodeURIComponent(accountId)}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n key: getRegistryConfigKey(accountId, gatewayId, pathSegments),\n limit: 1,\n }),\n },\n );\n const value = payload?.entries?.find(Boolean)?.value;\n\n if (!value) {\n throw new Error(`No config found for ${bosUrl}`);\n }\n\n if (typeof value === \"string\") {\n return JSON.parse(value) as T;\n }\n\n if (typeof value !== \"object\") {\n throw new Error(`Invalid config value for ${bosUrl}`);\n }\n\n return value as T;\n}\n\nexport interface PluginManifest {\n schemaVersion: number;\n kind: string;\n plugin: { name: string; version: string };\n runtime: { remoteEntry: string };\n contract: {\n kind: string;\n types: { path: string; exportName: string; typeName: string; sha256: string };\n };\n additionalExports?: Array<{ path: string; exports: string[]; sha256: string }>;\n}\n\nexport async function fetchRemotePluginManifest(cdnUrl: string): Promise<PluginManifest | null> {\n try {\n const baseUrl = cdnUrl.replace(/\\/$/, \"\");\n const response = await fetch(`${baseUrl}/plugin.manifest.json`);\n if (!response.ok) return null;\n return (await response.json()) as PluginManifest;\n } catch {\n return null;\n }\n}\n\nasync function fetchJson<T>(url: string, init?: RequestInit): Promise<T | null> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n ...(init?.headers ?? {}),\n },\n signal: controller.signal,\n });\n\n if (!response.ok) {\n return null;\n }\n\n return (await response.json()) as T;\n } finally {\n clearTimeout(timeout);\n }\n}\n"],"mappings":";AAUA,MAAM,oBAA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MAAM,UAAU,iBAAiB,WAAW,OAAO,EAAE,kBAAkB;AAEvE,KAAI;EACF,MAAM,WAAW,MAAM,MAAM,KAAK;GAChC,GAAG;GACH,SAAS;IACP,QAAQ;IACR,gBAAgB;IAChB,GAAI,MAAM,WAAW,EAAE;IACxB;GACD,QAAQ,WAAW;GACpB,CAAC;AAEF,MAAI,CAAC,SAAS,GACZ,QAAO;AAGT,SAAQ,MAAM,SAAS,MAAM;WACrB;AACR,eAAa,QAAQ"}
1
+ {"version":3,"file":"fastkv.mjs","names":[],"sources":["../src/fastkv.ts"],"sourcesContent":["export type NetworkId = \"mainnet\" | \"testnet\";\n\ninterface FastKvEntry {\n value: unknown;\n}\n\ninterface FastKvListResponse {\n entries?: Array<FastKvEntry | null>;\n}\n\nconst FASTKV_TIMEOUT_MS = 10_000;\n\nfunction getNetworkIdForAccount(accountId: string): NetworkId {\n return accountId.endsWith(\".testnet\") ? \"testnet\" : \"mainnet\";\n}\n\nexport function getFastKvBaseUrlForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_URL || \"https://kv.test.fastnear.com\"\n : process.env.REGISTRY_FASTKV_MAINNET_URL || \"https://kv.main.fastnear.com\";\n}\n\nfunction getFastKvBaseUrlForAccount(accountId: string): string {\n return getNetworkIdForAccount(accountId) === \"testnet\"\n ? getFastKvBaseUrlForNetwork(\"testnet\")\n : getFastKvBaseUrlForNetwork(\"mainnet\");\n}\n\nexport function buildRegistryConfigUrl(accountId: string, gatewayId: string): string {\n const baseUrl = getFastKvBaseUrlForAccount(accountId);\n const namespace = getRegistryNamespaceForAccount(accountId);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function buildRegistryConfigUrlForNetwork(\n network: NetworkId,\n accountId: string,\n gatewayId: string,\n): string {\n const baseUrl = getFastKvBaseUrlForNetwork(network);\n const namespace = getRegistryNamespaceForNetwork(network);\n const key = encodeURIComponent(getRegistryConfigKey(accountId, gatewayId));\n return `${baseUrl}/v0/latest/${encodeURIComponent(namespace)}/${encodeURIComponent(accountId)}/${key}`;\n}\n\nexport function getRegistryNamespaceForAccount(accountId: string): string {\n return accountId.endsWith(\".testnet\")\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nexport function getRegistryNamespaceForNetwork(network: NetworkId): string {\n return network === \"testnet\"\n ? process.env.REGISTRY_FASTKV_TESTNET_NAMESPACE || \"dev.everything.near\"\n : process.env.REGISTRY_FASTKV_MAINNET_NAMESPACE || \"dev.everything.near\";\n}\n\nfunction getRegistryConfigKey(\n accountId: string,\n gatewayId: string,\n pathSegments: string[] = [],\n): string {\n const suffix =\n pathSegments.length > 0\n ? `/${pathSegments.map((segment) => encodeURIComponent(segment)).join(\"/\")}`\n : \"\";\n return `apps/${accountId}/${gatewayId}${suffix}/bos.config.json`;\n}\n\nfunction parseBosUrl(bosUrl: string): {\n accountId: string;\n gatewayId: string;\n pathSegments: string[];\n} {\n const match = bosUrl.match(/^bos:\\/\\/([^/]+)\\/(.+)$/);\n if (!match?.[1] || !match[2]) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const pathSegments = match[2]\n .split(\"/\")\n .filter(Boolean)\n .map((segment) => decodeURIComponent(segment));\n if (pathSegments.length === 0) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n const [gatewayId, ...pathSegmentsTail] = pathSegments;\n if (!gatewayId) {\n throw new Error(`Invalid BOS URL: ${bosUrl}`);\n }\n\n return {\n accountId: match[1],\n gatewayId,\n pathSegments: pathSegmentsTail,\n };\n}\n\nexport async function fetchBosConfigFromFastKv<T>(bosUrl: string): Promise<T> {\n const { accountId, gatewayId, pathSegments } = parseBosUrl(bosUrl);\n const payload = await fetchJson<FastKvListResponse>(\n `${getFastKvBaseUrlForAccount(accountId)}/v0/latest/${encodeURIComponent(getRegistryNamespaceForAccount(accountId))}/${encodeURIComponent(accountId)}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n key: getRegistryConfigKey(accountId, gatewayId, pathSegments),\n limit: 1,\n }),\n },\n );\n const value = payload?.entries?.find(Boolean)?.value;\n\n if (!value) {\n throw new Error(`No config found for ${bosUrl}`);\n }\n\n if (typeof value === \"string\") {\n return JSON.parse(value) as T;\n }\n\n if (typeof value !== \"object\") {\n throw new Error(`Invalid config value for ${bosUrl}`);\n }\n\n return value as T;\n}\n\nexport interface PluginManifest {\n schemaVersion: number;\n kind: string;\n plugin: { name: string; version: string };\n runtime: { remoteEntry: string };\n contract: {\n kind: string;\n types: { path: string; exportName: string; typeName: string; sha256: string };\n };\n additionalExports?: Array<{ path: string; exports: string[]; sha256: string }>;\n}\n\nexport async function fetchRemotePluginManifest(cdnUrl: string): Promise<PluginManifest | null> {\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);\n const baseUrl = cdnUrl.replace(/\\/$/, \"\");\n const response = await fetch(`${baseUrl}/plugin.manifest.json`, {\n signal: controller.signal,\n });\n clearTimeout(timeout);\n if (!response.ok) return null;\n return (await response.json()) as PluginManifest;\n } catch {\n return null;\n }\n}\n\nasync function fetchJson<T>(url: string, init?: RequestInit): Promise<T | null> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), FASTKV_TIMEOUT_MS);\n\n try {\n const response = await fetch(url, {\n ...init,\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n ...(init?.headers ?? {}),\n },\n signal: controller.signal,\n });\n\n if (!response.ok) {\n return null;\n }\n\n return (await response.json()) as T;\n } finally {\n clearTimeout(timeout);\n }\n}\n"],"mappings":";AAUA,MAAM,oBAAoB;AAE1B,SAAS,uBAAuB,WAA8B;AAC5D,QAAO,UAAU,SAAS,WAAW,GAAG,YAAY;;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AAa,KAAa,MAAuC;CAC9E,MAAM,aAAa,IAAI,iBAAiB;CACxC,MAAM,UAAU,iBAAiB,WAAW,OAAO,EAAE,kBAAkB;AAEvE,KAAI;EACF,MAAM,WAAW,MAAM,MAAM,KAAK;GAChC,GAAG;GACH,SAAS;IACP,QAAQ;IACR,gBAAgB;IAChB,GAAI,MAAM,WAAW,EAAE;IACxB;GACD,QAAQ,WAAW;GACpB,CAAC;AAEF,MAAI,CAAC,SAAS,GACZ,QAAO;AAGT,SAAQ,MAAM,SAAS,MAAM;WACrB;AACR,eAAa,QAAQ"}
package/dist/index.cjs CHANGED
@@ -53,6 +53,7 @@ Object.defineProperty(exports, 'Layer', {
53
53
  return every_plugin_effect.Layer;
54
54
  }
55
55
  });
56
+ exports.OverrideSectionSchema = require_contract.OverrideSectionSchema;
56
57
  exports.PhaseTimingSchema = require_contract.PhaseTimingSchema;
57
58
  exports.PluginAddOptionsSchema = require_contract.PluginAddOptionsSchema;
58
59
  exports.PluginAddResultSchema = require_contract.PluginAddResultSchema;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { AnyContractRouter, AnySchema, Context, Effect, Layer, LoadedPluginWithBinding, Plugin, PluginRuntime, Scope, createPlugin, createPluginRuntime, oc, z } from "./sdk.cjs";
2
+ import { BosConfigResult, BuildOptions, BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptions, DevOptionsSchema, DevResultSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, OverrideSection, OverrideSectionSchema, PhaseTiming, PhaseTimingSchema, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginListResult, PluginListResultSchema, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract } from "./contract.cjs";
2
3
  import { ApiPluginConfig, ApiPluginConfigSchema, BosConfig, BosConfigInput, BosConfigInputAppEntry, BosConfigInputSchema, BosConfigSchema, BosPluginRef, BosPluginRefSchema, BosStaging, BosStagingSchema, ClientRuntimeConfig, ClientRuntimeConfigSchema, ClientRuntimeInfo, ClientRuntimeInfoSchema, ComposableAppEntry, ComposableAppEntrySchema, Extends, ExtendsConfig, ExtendsSchema, FederationEntry, FederationEntrySchema, HostConfig, HostConfigSchema, PluginEntries, PluginEntryValue, PluginRuntimeUi, PluginUiConfig, PluginUiConfigSchema, RuntimeConfig, RuntimeConfigSchema, RuntimePluginConfig, RuntimePluginConfigSchema, SharedConfig, SharedConfigSchema, SharedDepConfig, SharedDepConfigSchema, SidebarItem, SidebarItemSchema, SidebarRole, SidebarRoleSchema, SourceMode, SourceModeSchema, UiConfig, UiConfigSchema } from "./types.cjs";
3
4
  import { BOS_CONFIG_ORDER, rebuildOrderedConfig } from "./merge.cjs";
4
5
  import { BuildRuntimeConfigOptions, ConfigResult, ResolvedComposableReference, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, findConfigPath, getConfig, getHostDevelopmentPort, getProjectRoot, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, parsePort, readBosConfigForBuild, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writeResolvedConfig } from "./config.cjs";
5
6
  import { CliCommandMeta, cliCommandMeta } from "./contract.meta.cjs";
6
7
  import { NetworkId, PluginManifest, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, fetchBosConfigFromFastKv, fetchRemotePluginManifest, getFastKvBaseUrlForNetwork, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork } from "./fastkv.cjs";
7
- import { BosConfigResult, BuildOptions, BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptions, DevOptionsSchema, DevResultSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, PhaseTiming, PhaseTimingSchema, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginListResult, PluginListResultSchema, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract } from "./contract.cjs";
8
8
  import { generatePluginSidebarContent, writePluginSidebarGen } from "./sidebar.cjs";
9
- export { AnyContractRouter, AnySchema, ApiPluginConfig, ApiPluginConfigSchema, BOS_CONFIG_ORDER, BosConfig, BosConfigInput, BosConfigInputAppEntry, BosConfigInputSchema, BosConfigResult, BosConfigSchema, BosPluginRef, BosPluginRefSchema, BosStaging, BosStagingSchema, BuildOptions, BuildOptionsSchema, BuildResultSchema, BuildRuntimeConfigOptions, CliCommandMeta, ClientRuntimeConfig, ClientRuntimeConfigSchema, ClientRuntimeInfo, ClientRuntimeInfoSchema, ComposableAppEntry, ComposableAppEntrySchema, ConfigResult, ConfigResultSchema, Context, DevOptions, DevOptionsSchema, DevResultSchema, Effect, Extends, ExtendsConfig, ExtendsSchema, FederationEntry, FederationEntrySchema, HostConfig, HostConfigSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, Layer, LoadedPluginWithBinding, NetworkId, PhaseTiming, PhaseTimingSchema, Plugin, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginEntries, PluginEntryValue, PluginListResult, PluginListResultSchema, PluginManifest, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PluginRuntime, PluginRuntimeUi, PluginUiConfig, PluginUiConfigSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, ResolvedComposableReference, RuntimeConfig, RuntimeConfigSchema, RuntimePluginConfig, RuntimePluginConfigSchema, Scope, SharedConfig, SharedConfigSchema, SharedDepConfig, SharedDepConfigSchema, SidebarItem, SidebarItemSchema, SidebarRole, SidebarRoleSchema, SourceMode, SourceModeSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UiConfig, UiConfigSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, cliCommandMeta, createPlugin, createPluginRuntime, fetchBosConfigFromFastKv, fetchRemotePluginManifest, findConfigPath, generatePluginSidebarContent, getConfig, getFastKvBaseUrlForNetwork, getHostDevelopmentPort, getProjectRoot, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, oc, parsePort, readBosConfigForBuild, rebuildOrderedConfig, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writePluginSidebarGen, writeResolvedConfig, z };
9
+ export { AnyContractRouter, AnySchema, ApiPluginConfig, ApiPluginConfigSchema, BOS_CONFIG_ORDER, BosConfig, BosConfigInput, BosConfigInputAppEntry, BosConfigInputSchema, BosConfigResult, BosConfigSchema, BosPluginRef, BosPluginRefSchema, BosStaging, BosStagingSchema, BuildOptions, BuildOptionsSchema, BuildResultSchema, BuildRuntimeConfigOptions, CliCommandMeta, ClientRuntimeConfig, ClientRuntimeConfigSchema, ClientRuntimeInfo, ClientRuntimeInfoSchema, ComposableAppEntry, ComposableAppEntrySchema, ConfigResult, ConfigResultSchema, Context, DevOptions, DevOptionsSchema, DevResultSchema, Effect, Extends, ExtendsConfig, ExtendsSchema, FederationEntry, FederationEntrySchema, HostConfig, HostConfigSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, Layer, LoadedPluginWithBinding, NetworkId, OverrideSection, OverrideSectionSchema, PhaseTiming, PhaseTimingSchema, Plugin, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginEntries, PluginEntryValue, PluginListResult, PluginListResultSchema, PluginManifest, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PluginRuntime, PluginRuntimeUi, PluginUiConfig, PluginUiConfigSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, ResolvedComposableReference, RuntimeConfig, RuntimeConfigSchema, RuntimePluginConfig, RuntimePluginConfigSchema, Scope, SharedConfig, SharedConfigSchema, SharedDepConfig, SharedDepConfigSchema, SidebarItem, SidebarItemSchema, SidebarRole, SidebarRoleSchema, SourceMode, SourceModeSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UiConfig, UiConfigSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, cliCommandMeta, createPlugin, createPluginRuntime, fetchBosConfigFromFastKv, fetchRemotePluginManifest, findConfigPath, generatePluginSidebarContent, getConfig, getFastKvBaseUrlForNetwork, getHostDevelopmentPort, getProjectRoot, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, oc, parsePort, readBosConfigForBuild, rebuildOrderedConfig, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writePluginSidebarGen, writeResolvedConfig, z };
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { AnyContractRouter, AnySchema, Context, Effect, Layer, LoadedPluginWithBinding, Plugin, PluginRuntime, Scope, createPlugin, createPluginRuntime, oc, z } from "./sdk.mjs";
2
+ import { BosConfigResult, BuildOptions, BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptions, DevOptionsSchema, DevResultSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, OverrideSection, OverrideSectionSchema, PhaseTiming, PhaseTimingSchema, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginListResult, PluginListResultSchema, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract } from "./contract.mjs";
2
3
  import { ApiPluginConfig, ApiPluginConfigSchema, BosConfig, BosConfigInput, BosConfigInputAppEntry, BosConfigInputSchema, BosConfigSchema, BosPluginRef, BosPluginRefSchema, BosStaging, BosStagingSchema, ClientRuntimeConfig, ClientRuntimeConfigSchema, ClientRuntimeInfo, ClientRuntimeInfoSchema, ComposableAppEntry, ComposableAppEntrySchema, Extends, ExtendsConfig, ExtendsSchema, FederationEntry, FederationEntrySchema, HostConfig, HostConfigSchema, PluginEntries, PluginEntryValue, PluginRuntimeUi, PluginUiConfig, PluginUiConfigSchema, RuntimeConfig, RuntimeConfigSchema, RuntimePluginConfig, RuntimePluginConfigSchema, SharedConfig, SharedConfigSchema, SharedDepConfig, SharedDepConfigSchema, SidebarItem, SidebarItemSchema, SidebarRole, SidebarRoleSchema, SourceMode, SourceModeSchema, UiConfig, UiConfigSchema } from "./types.mjs";
3
4
  import { BOS_CONFIG_ORDER, rebuildOrderedConfig } from "./merge.mjs";
4
5
  import { BuildRuntimeConfigOptions, ConfigResult, ResolvedComposableReference, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, findConfigPath, getConfig, getHostDevelopmentPort, getProjectRoot, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, parsePort, readBosConfigForBuild, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writeResolvedConfig } from "./config.mjs";
5
6
  import { CliCommandMeta, cliCommandMeta } from "./contract.meta.mjs";
6
7
  import { NetworkId, PluginManifest, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, fetchBosConfigFromFastKv, fetchRemotePluginManifest, getFastKvBaseUrlForNetwork, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork } from "./fastkv.mjs";
7
- import { BosConfigResult, BuildOptions, BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptions, DevOptionsSchema, DevResultSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, PhaseTiming, PhaseTimingSchema, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginListResult, PluginListResultSchema, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract } from "./contract.mjs";
8
8
  import { generatePluginSidebarContent, writePluginSidebarGen } from "./sidebar.mjs";
9
- export { AnyContractRouter, AnySchema, ApiPluginConfig, ApiPluginConfigSchema, BOS_CONFIG_ORDER, BosConfig, BosConfigInput, BosConfigInputAppEntry, BosConfigInputSchema, BosConfigResult, BosConfigSchema, BosPluginRef, BosPluginRefSchema, BosStaging, BosStagingSchema, BuildOptions, BuildOptionsSchema, BuildResultSchema, BuildRuntimeConfigOptions, CliCommandMeta, ClientRuntimeConfig, ClientRuntimeConfigSchema, ClientRuntimeInfo, ClientRuntimeInfoSchema, ComposableAppEntry, ComposableAppEntrySchema, ConfigResult, ConfigResultSchema, Context, DevOptions, DevOptionsSchema, DevResultSchema, Effect, Extends, ExtendsConfig, ExtendsSchema, FederationEntry, FederationEntrySchema, HostConfig, HostConfigSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, Layer, LoadedPluginWithBinding, NetworkId, PhaseTiming, PhaseTimingSchema, Plugin, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginEntries, PluginEntryValue, PluginListResult, PluginListResultSchema, PluginManifest, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PluginRuntime, PluginRuntimeUi, PluginUiConfig, PluginUiConfigSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, ResolvedComposableReference, RuntimeConfig, RuntimeConfigSchema, RuntimePluginConfig, RuntimePluginConfigSchema, Scope, SharedConfig, SharedConfigSchema, SharedDepConfig, SharedDepConfigSchema, SidebarItem, SidebarItemSchema, SidebarRole, SidebarRoleSchema, SourceMode, SourceModeSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UiConfig, UiConfigSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, cliCommandMeta, createPlugin, createPluginRuntime, fetchBosConfigFromFastKv, fetchRemotePluginManifest, findConfigPath, generatePluginSidebarContent, getConfig, getFastKvBaseUrlForNetwork, getHostDevelopmentPort, getProjectRoot, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, oc, parsePort, readBosConfigForBuild, rebuildOrderedConfig, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writePluginSidebarGen, writeResolvedConfig, z };
9
+ export { AnyContractRouter, AnySchema, ApiPluginConfig, ApiPluginConfigSchema, BOS_CONFIG_ORDER, BosConfig, BosConfigInput, BosConfigInputAppEntry, BosConfigInputSchema, BosConfigResult, BosConfigSchema, BosPluginRef, BosPluginRefSchema, BosStaging, BosStagingSchema, BuildOptions, BuildOptionsSchema, BuildResultSchema, BuildRuntimeConfigOptions, CliCommandMeta, ClientRuntimeConfig, ClientRuntimeConfigSchema, ClientRuntimeInfo, ClientRuntimeInfoSchema, ComposableAppEntry, ComposableAppEntrySchema, ConfigResult, ConfigResultSchema, Context, DevOptions, DevOptionsSchema, DevResultSchema, Effect, Extends, ExtendsConfig, ExtendsSchema, FederationEntry, FederationEntrySchema, HostConfig, HostConfigSchema, InitOptions, InitOptionsSchema, InitResult, InitResultSchema, KeyPublishOptions, KeyPublishOptionsSchema, KeyPublishResult, KeyPublishResultSchema, Layer, LoadedPluginWithBinding, NetworkId, OverrideSection, OverrideSectionSchema, PhaseTiming, PhaseTimingSchema, Plugin, PluginAddOptions, PluginAddOptionsSchema, PluginAddResult, PluginAddResultSchema, PluginEntries, PluginEntryValue, PluginListResult, PluginListResultSchema, PluginManifest, PluginPublishOptions, PluginPublishOptionsSchema, PluginPublishResult, PluginPublishResultSchema, PluginRemoveOptions, PluginRemoveOptionsSchema, PluginRemoveResult, PluginRemoveResultSchema, PluginRuntime, PluginRuntimeUi, PluginUiConfig, PluginUiConfigSchema, PublishOptions, PublishOptionsSchema, PublishResultSchema, ResolvedComposableReference, RuntimeConfig, RuntimeConfigSchema, RuntimePluginConfig, RuntimePluginConfigSchema, Scope, SharedConfig, SharedConfigSchema, SharedDepConfig, SharedDepConfigSchema, SidebarItem, SidebarItemSchema, SidebarRole, SidebarRoleSchema, SourceMode, SourceModeSchema, StartOptions, StartOptionsSchema, StartResultSchema, StatusResult, StatusResultSchema, SyncOptions, SyncOptionsSchema, SyncResult, SyncResultSchema, TypesGenOptions, TypesGenOptionsSchema, TypesGenResult, TypesGenResultSchema, UiConfig, UiConfigSchema, UpgradeOptions, UpgradeOptionsSchema, UpgradeResult, UpgradeResultSchema, bosContract, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, cliCommandMeta, createPlugin, createPluginRuntime, fetchBosConfigFromFastKv, fetchRemotePluginManifest, findConfigPath, generatePluginSidebarContent, getConfig, getFastKvBaseUrlForNetwork, getHostDevelopmentPort, getProjectRoot, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, oc, parsePort, readBosConfigForBuild, rebuildOrderedConfig, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writePluginSidebarGen, writeResolvedConfig, z };
package/dist/index.mjs CHANGED
@@ -3,9 +3,9 @@ import { BOS_CONFIG_ORDER, rebuildOrderedConfig } from "./merge.mjs";
3
3
  import { Context, Effect, Layer, PluginRuntime, Scope, createPlugin, createPluginRuntime, oc, z } from "./sdk.mjs";
4
4
  import { ApiPluginConfigSchema, BosConfigInputSchema, BosConfigSchema, BosPluginRefSchema, BosStagingSchema, ClientRuntimeConfigSchema, ClientRuntimeInfoSchema, ComposableAppEntrySchema, ExtendsSchema, FederationEntrySchema, HostConfigSchema, PluginUiConfigSchema, RuntimeConfigSchema, RuntimePluginConfigSchema, SharedConfigSchema, SharedDepConfigSchema, SidebarItemSchema, SidebarRoleSchema, SourceModeSchema, UiConfigSchema } from "./types.mjs";
5
5
  import { buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, findConfigPath, getConfig, getHostDevelopmentPort, getProjectRoot, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, parsePort, readBosConfigForBuild, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writeResolvedConfig } from "./config.mjs";
6
- import { BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptionsSchema, DevResultSchema, InitOptionsSchema, InitResultSchema, KeyPublishOptionsSchema, KeyPublishResultSchema, PhaseTimingSchema, PluginAddOptionsSchema, PluginAddResultSchema, PluginListResultSchema, PluginPublishOptionsSchema, PluginPublishResultSchema, PluginRemoveOptionsSchema, PluginRemoveResultSchema, PublishOptionsSchema, PublishResultSchema, StartOptionsSchema, StartResultSchema, StatusResultSchema, SyncOptionsSchema, SyncResultSchema, TypesGenOptionsSchema, TypesGenResultSchema, UpgradeOptionsSchema, UpgradeResultSchema, bosContract } from "./contract.mjs";
6
+ import { BuildOptionsSchema, BuildResultSchema, ConfigResultSchema, DevOptionsSchema, DevResultSchema, InitOptionsSchema, InitResultSchema, KeyPublishOptionsSchema, KeyPublishResultSchema, OverrideSectionSchema, PhaseTimingSchema, PluginAddOptionsSchema, PluginAddResultSchema, PluginListResultSchema, PluginPublishOptionsSchema, PluginPublishResultSchema, PluginRemoveOptionsSchema, PluginRemoveResultSchema, PublishOptionsSchema, PublishResultSchema, StartOptionsSchema, StartResultSchema, StatusResultSchema, SyncOptionsSchema, SyncResultSchema, TypesGenOptionsSchema, TypesGenResultSchema, UpgradeOptionsSchema, UpgradeResultSchema, bosContract } from "./contract.mjs";
7
7
  import { cliCommandMeta } from "./contract.meta.mjs";
8
8
  import { generatePluginSidebarContent, writePluginSidebarGen } from "./sidebar.mjs";
9
9
  import "./plugin.mjs";
10
10
 
11
- export { ApiPluginConfigSchema, BOS_CONFIG_ORDER, BosConfigInputSchema, BosConfigSchema, BosPluginRefSchema, BosStagingSchema, BuildOptionsSchema, BuildResultSchema, ClientRuntimeConfigSchema, ClientRuntimeInfoSchema, ComposableAppEntrySchema, ConfigResultSchema, Context, DevOptionsSchema, DevResultSchema, Effect, ExtendsSchema, FederationEntrySchema, HostConfigSchema, InitOptionsSchema, InitResultSchema, KeyPublishOptionsSchema, KeyPublishResultSchema, Layer, PhaseTimingSchema, PluginAddOptionsSchema, PluginAddResultSchema, PluginListResultSchema, PluginPublishOptionsSchema, PluginPublishResultSchema, PluginRemoveOptionsSchema, PluginRemoveResultSchema, PluginRuntime, PluginUiConfigSchema, PublishOptionsSchema, PublishResultSchema, RuntimeConfigSchema, RuntimePluginConfigSchema, Scope, SharedConfigSchema, SharedDepConfigSchema, SidebarItemSchema, SidebarRoleSchema, SourceModeSchema, StartOptionsSchema, StartResultSchema, StatusResultSchema, SyncOptionsSchema, SyncResultSchema, TypesGenOptionsSchema, TypesGenResultSchema, UiConfigSchema, UpgradeOptionsSchema, UpgradeResultSchema, bosContract, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, cliCommandMeta, createPlugin, createPluginRuntime, fetchBosConfigFromFastKv, fetchRemotePluginManifest, findConfigPath, generatePluginSidebarContent, getConfig, getFastKvBaseUrlForNetwork, getHostDevelopmentPort, getProjectRoot, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, oc, parsePort, readBosConfigForBuild, rebuildOrderedConfig, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writePluginSidebarGen, writeResolvedConfig, z };
11
+ export { ApiPluginConfigSchema, BOS_CONFIG_ORDER, BosConfigInputSchema, BosConfigSchema, BosPluginRefSchema, BosStagingSchema, BuildOptionsSchema, BuildResultSchema, ClientRuntimeConfigSchema, ClientRuntimeInfoSchema, ComposableAppEntrySchema, ConfigResultSchema, Context, DevOptionsSchema, DevResultSchema, Effect, ExtendsSchema, FederationEntrySchema, HostConfigSchema, InitOptionsSchema, InitResultSchema, KeyPublishOptionsSchema, KeyPublishResultSchema, Layer, OverrideSectionSchema, PhaseTimingSchema, PluginAddOptionsSchema, PluginAddResultSchema, PluginListResultSchema, PluginPublishOptionsSchema, PluginPublishResultSchema, PluginRemoveOptionsSchema, PluginRemoveResultSchema, PluginRuntime, PluginUiConfigSchema, PublishOptionsSchema, PublishResultSchema, RuntimeConfigSchema, RuntimePluginConfigSchema, Scope, SharedConfigSchema, SharedDepConfigSchema, SidebarItemSchema, SidebarRoleSchema, SourceModeSchema, StartOptionsSchema, StartResultSchema, StatusResultSchema, SyncOptionsSchema, SyncResultSchema, TypesGenOptionsSchema, TypesGenResultSchema, UiConfigSchema, UpgradeOptionsSchema, UpgradeResultSchema, bosContract, buildRegistryConfigUrl, buildRegistryConfigUrlForNetwork, buildRuntimeConfig, buildRuntimePluginsForConfig, clearConfigCache, cliCommandMeta, createPlugin, createPluginRuntime, fetchBosConfigFromFastKv, fetchRemotePluginManifest, findConfigPath, generatePluginSidebarContent, getConfig, getFastKvBaseUrlForNetwork, getHostDevelopmentPort, getProjectRoot, getRegistryNamespaceForAccount, getRegistryNamespaceForNetwork, getResolvedConfigPath, isLocalDevelopmentTarget, loadBosConfig, loadConfig, loadResolvedConfig, oc, parsePort, readBosConfigForBuild, rebuildOrderedConfig, resolveBosConfigPath, resolveComposableReference, resolveDevelopmentHostUrl, resolveLocalDevelopmentPath, resolvePluginRuntimeName, writePluginSidebarGen, writeResolvedConfig, z };
package/dist/plugin.cjs CHANGED
@@ -784,7 +784,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
784
784
  let directory = input.directory;
785
785
  let account = input.account;
786
786
  let domain = input.domain;
787
- let withHost = input.withHost;
787
+ let overrides = input.overrides;
788
788
  let plugins = input.plugins;
789
789
  if (input.extends) {
790
790
  const match = (input.extends.startsWith("bos://") ? input.extends : `bos://${input.extends}`).match(/^bos:\/\/([^/]+)\/(.+)$/);
@@ -811,7 +811,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
811
811
  account,
812
812
  domain,
813
813
  plugins,
814
- withHost,
814
+ overrides,
815
815
  parentPluginKeys
816
816
  });
817
817
  extendsAccount = prompted.extendsAccount;
@@ -819,14 +819,18 @@ var plugin_default = (0, every_plugin.createPlugin)({
819
819
  directory = prompted.directory;
820
820
  account = prompted.account;
821
821
  domain = prompted.domain;
822
- withHost = prompted.withHost;
823
822
  plugins = prompted.plugins;
823
+ overrides = prompted.overrides;
824
824
  s.start("Setting up project");
825
825
  }
826
+ overrides = overrides?.length ? overrides : ["ui", "api"];
827
+ if (overrides.includes("plugins") && !plugins?.length) plugins = parentPluginKeys;
828
+ plugins = plugins ?? [];
826
829
  directory = directory || domain || extendsGateway;
827
830
  const targetDir = (0, node_path.resolve)(directory);
828
- plugins = plugins ?? [];
829
831
  const extendsRef = `bos://${extendsAccount}/${extendsGateway}`;
832
+ if (overrides.includes("plugins") && !plugins.length) {}
833
+ const repository = await require_cli_init.detectGitRemoteUrl(process.cwd()).catch(() => void 0) ?? parentConfig?.repository;
830
834
  if (!parentConfig) try {
831
835
  parentConfig = await require_timing.timePhase(timings, "parent config", () => require_cli_init.fetchParentConfig(extendsAccount, extendsGateway), s);
832
836
  } catch {
@@ -838,7 +842,8 @@ var plugin_default = (0, every_plugin.createPlugin)({
838
842
  account,
839
843
  domain,
840
844
  extends: extendsRef,
841
- plugins: plugins ?? [],
845
+ plugins,
846
+ overrides,
842
847
  filesCopied: 0,
843
848
  timings,
844
849
  error: `No config found at ${extendsRef} — are you sure this is the right parent?`
@@ -853,15 +858,27 @@ var plugin_default = (0, every_plugin.createPlugin)({
853
858
  const isMinimalScaffold = sourceDir === "";
854
859
  try {
855
860
  let filesCopied;
856
- if (isMinimalScaffold) filesCopied = await require_timing.timePhase(timings, "scaffold project", () => require_cli_init.scaffoldMinimalProject(targetDir, parentConfig, {
857
- extendsAccount,
858
- extendsGateway,
859
- account: account || extendsAccount,
860
- domain,
861
- plugins,
862
- withHost
863
- }), s);
864
- else {
861
+ if (isMinimalScaffold) {
862
+ filesCopied = await require_timing.timePhase(timings, "scaffold project", () => require_cli_init.scaffoldMinimalProject(targetDir, parentConfig, {
863
+ extendsAccount,
864
+ extendsGateway,
865
+ account: account || extendsAccount,
866
+ domain,
867
+ plugins,
868
+ overrides,
869
+ repository
870
+ }), s);
871
+ await require_timing.timePhase(timings, "personalize config", () => require_cli_init.personalizeConfig(targetDir, {
872
+ extendsAccount,
873
+ extendsGateway,
874
+ account: account || extendsAccount,
875
+ domain: domain || extendsGateway,
876
+ plugins,
877
+ overrides,
878
+ mode: "init",
879
+ repository
880
+ }), s);
881
+ } else {
865
882
  const patterns = await require_cli_init.readTemplatekeep(sourceDir);
866
883
  if (patterns.length === 0) {
867
884
  s.stop("Failed");
@@ -872,16 +889,19 @@ var plugin_default = (0, every_plugin.createPlugin)({
872
889
  account,
873
890
  domain,
874
891
  extends: extendsRef,
875
- plugins: plugins ?? [],
892
+ plugins,
893
+ overrides,
876
894
  filesCopied: 0,
877
895
  error: "No .templatekeep found in template source"
878
896
  };
879
897
  }
880
898
  const pluginRoutes = {};
881
- const parentRuntimePlugins = await require_config.buildRuntimePluginsForConfig(parentConfig, sourceDir, "production");
882
- for (const [key, plugin] of Object.entries(parentRuntimePlugins ?? {})) if (plugin.routes && plugin.routes.length > 0) pluginRoutes[key] = plugin.routes;
899
+ if (overrides.includes("plugins")) {
900
+ const parentRuntimePlugins = await require_config.buildRuntimePluginsForConfig(parentConfig, sourceDir, "production");
901
+ for (const [key, plugin] of Object.entries(parentRuntimePlugins ?? {})) if (plugin.routes && plugin.routes.length > 0) pluginRoutes[key] = plugin.routes;
902
+ }
883
903
  filesCopied = await require_timing.timePhase(timings, "copy files", () => require_cli_init.copyFilteredFiles(sourceDir, targetDir, patterns, {
884
- withHost,
904
+ overrides,
885
905
  plugins,
886
906
  pluginRoutes
887
907
  }), s);
@@ -891,12 +911,13 @@ var plugin_default = (0, every_plugin.createPlugin)({
891
911
  account: account || extendsAccount,
892
912
  domain: domain || extendsGateway,
893
913
  plugins,
914
+ overrides,
894
915
  pluginRoutes,
895
916
  workspaceOpts: { sourceDir },
896
- withHost
917
+ repository
897
918
  }), s);
898
919
  await require_timing.timePhase(timings, "write snapshot", () => require_cli_init.writeInitSnapshot(targetDir, extendsAccount, extendsGateway, sourceDir, patterns, {
899
- withHost,
920
+ overrides,
900
921
  plugins,
901
922
  pluginRoutes
902
923
  }), s);
@@ -939,6 +960,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
939
960
  domain,
940
961
  extends: extendsRef,
941
962
  plugins,
963
+ overrides,
942
964
  filesCopied,
943
965
  timings
944
966
  };
@@ -955,6 +977,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
955
977
  domain: input.domain,
956
978
  extends: extendsRef,
957
979
  plugins: input.plugins ?? [],
980
+ overrides: input.overrides,
958
981
  filesCopied: 0,
959
982
  timings: [],
960
983
  error: error instanceof Error ? error.message : "Unknown error"