wizards 0.2.45 → 0.2.47

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 (70) hide show
  1. package/apps/runtime/dist/app.js +34 -1
  2. package/apps/runtime/dist/cli/features.js +50 -0
  3. package/apps/runtime/dist/cli/main.js +12 -2
  4. package/apps/runtime/dist/cli/report.js +81 -0
  5. package/apps/runtime/dist/debug.js +196 -0
  6. package/apps/runtime/dist/features.js +123 -0
  7. package/apps/runtime/dist/harness/model.js +2 -0
  8. package/apps/runtime/dist/index.js +3 -0
  9. package/apps/runtime/dist/log.js +106 -0
  10. package/apps/runtime/dist/manage.js +13 -0
  11. package/apps/runtime/dist/plugins/discovery.js +11 -0
  12. package/apps/runtime/dist/plugins/loader.js +10 -0
  13. package/apps/runtime/dist/routes/debug.js +42 -0
  14. package/apps/runtime/dist/routes/internal.js +21 -5
  15. package/apps/runtime/dist/routes/runs.js +1 -1
  16. package/apps/runtime/dist/routes/studio.js +7 -5
  17. package/apps/runtime/dist/tenants/control.js +7 -0
  18. package/apps/web/dist/assets/{AboutDialog-Dx_ged8B.js → AboutDialog-t7bpiasT.js} +1 -1
  19. package/apps/web/dist/assets/{ChangelogDialog-CbEGxGZG.js → ChangelogDialog-B87yS6aN.js} +1 -1
  20. package/apps/web/dist/assets/{ChatView-DZm3GK6k.js → ChatView-Dm764bYy.js} +4 -4
  21. package/apps/web/dist/assets/EditorPage-BG_Ue2iC.js +3 -0
  22. package/apps/web/dist/assets/{FlowPreview-t7hVutQM.js → FlowPreview-ChXfiMn_.js} +1 -1
  23. package/apps/web/dist/assets/{Harness-DnUFOVKn.js → Harness-zKMptCzB.js} +2 -2
  24. package/apps/web/dist/assets/HomePage-BXSg5P5k.js +1 -0
  25. package/apps/web/dist/assets/{Marketplace-SLjncUHh.js → Marketplace-BWhUJ4UX.js} +2 -2
  26. package/apps/web/dist/assets/{NewWizardPage-D24mz6nu.js → NewWizardPage-C3NqEGmg.js} +1 -1
  27. package/apps/web/dist/assets/ProjectPage-D6Fy7uTV.js +2 -0
  28. package/apps/web/dist/assets/PublicRunner-ChgJs0C9.js +1 -0
  29. package/apps/web/dist/assets/{ReadOnly-BokOQXGX.js → ReadOnly-C9P9aiU6.js} +1 -1
  30. package/apps/web/dist/assets/{RunDrawer-BLxTUquf.js → RunDrawer-CvIKLphz.js} +3 -3
  31. package/apps/web/dist/assets/RunnerView-Bmayop7s.js +2 -0
  32. package/apps/web/dist/assets/SettingsPage-QkwtRFoD.js +1 -0
  33. package/apps/web/dist/assets/SetupPage-B3IOQLO3.js +1 -0
  34. package/apps/web/dist/assets/{SharePage-D30PD4st.js → SharePage-C3QEzicl.js} +1 -1
  35. package/apps/web/dist/assets/ThemeSwitch-3IzIOlNz.js +1 -0
  36. package/apps/web/dist/assets/arrow-right-Dpp_mpHe.js +1 -0
  37. package/apps/web/dist/assets/changelog-Du2gWzlN.js +1 -0
  38. package/apps/web/dist/assets/{circle-alert-DmnHyrXp.js → circle-alert-CPo3Naay.js} +1 -1
  39. package/apps/web/dist/assets/{definition-TTirPrTQ.js → definition-CQGiBQ4X.js} +1 -1
  40. package/apps/web/dist/assets/{external-link-CbsKNS8Z.js → external-link-CpU8aJY2.js} +1 -1
  41. package/apps/web/dist/assets/index-Cz6c1S5g.js +78 -0
  42. package/apps/web/dist/assets/{lock-CjhgdsXt.js → lock-C_WlXIQ0.js} +1 -1
  43. package/apps/web/dist/assets/{refresh-cw-Obopmbfz.js → refresh-cw-Cli5WGnW.js} +1 -1
  44. package/apps/web/dist/assets/{session-OPJXuQ-4.js → session-miDEdw2c.js} +1 -1
  45. package/apps/web/dist/assets/{settings-menu-Dme1HWda.js → settings-menu-ROT8Lbbj.js} +1 -1
  46. package/apps/web/dist/assets/{sparkles-DQnR0qxG.js → sparkles-CP5H-O1E.js} +1 -1
  47. package/apps/web/dist/assets/{trash-CDGh6DEg.js → trash-DU-hZpV0.js} +1 -1
  48. package/apps/web/dist/assets/ui-D92EkdEB.js +9 -0
  49. package/apps/web/dist/assets/{upload-BzfKj43F.js → upload-DMq5N6Fw.js} +1 -1
  50. package/apps/web/dist/assets/{volume-2-Dca_TstC.js → volume-2-0SfkvOho.js} +1 -1
  51. package/apps/web/dist/index.html +10 -10
  52. package/apps/web/dist/mcp/flow.html +41 -41
  53. package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +21 -0
  54. package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +54 -0
  55. package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +46 -0
  56. package/node_modules/@engenty-wizards/shared/dist/features.d.ts +36 -0
  57. package/node_modules/@engenty-wizards/shared/dist/features.js +78 -0
  58. package/package.json +1 -1
  59. package/apps/web/dist/assets/EditorPage-DYmr37s6.js +0 -3
  60. package/apps/web/dist/assets/HomePage-BtDteNOG.js +0 -1
  61. package/apps/web/dist/assets/ProjectPage-BrJp7tGj.js +0 -2
  62. package/apps/web/dist/assets/PublicRunner-c3A01WoK.js +0 -1
  63. package/apps/web/dist/assets/RunnerView-BCXVgQJg.js +0 -2
  64. package/apps/web/dist/assets/SettingsPage-CUZcrDWr.js +0 -1
  65. package/apps/web/dist/assets/SetupPage-DVM5r96i.js +0 -1
  66. package/apps/web/dist/assets/ThemeSwitch-BeoISyt6.js +0 -1
  67. package/apps/web/dist/assets/arrow-right-BeQQ3XNo.js +0 -1
  68. package/apps/web/dist/assets/changelog-CpOw96D-.js +0 -1
  69. package/apps/web/dist/assets/index-C67UNafO.js +0 -78
  70. package/apps/web/dist/assets/ui-BJwZ9JV4.js +0 -9
@@ -22,6 +22,17 @@ export interface PluginManifest {
22
22
  studio?: string;
23
23
  /** The studio half's styles, built. Default `dist/client.css`. */
24
24
  styles?: string;
25
+ /**
26
+ * The plugin's feature switches, by short name; each is known as `<id>.<name>` everywhere
27
+ * (`wizards features`, the `.features` file, the Manage-App's admin). `true`/`false` is the
28
+ * default alone; a `plan` switch is one a plan includes.
29
+ */
30
+ features?: Record<string, boolean | {
31
+ kind?: "release" | "plan";
32
+ default?: boolean;
33
+ label?: string;
34
+ hint?: string;
35
+ }>;
25
36
  }
26
37
  export type PluginRole = "owner" | "admin" | "member";
27
38
  /** The signed-in person a request acts as. */
@@ -845,6 +856,16 @@ export interface WizardsPluginApi {
845
856
  config: {
846
857
  get(key: string): string | undefined;
847
858
  };
859
+ /**
860
+ * Feature switches of the tenant at hand: the runtime's own (`teamPlans`) and the plugin's,
861
+ * named with its id (`contacts.leadScoring`), as the Manage-App, the install's `.features`
862
+ * file or `FEATURES` set them. Off unless something turned a switch on.
863
+ */
864
+ features: {
865
+ /** `has("leadScoring")` asks for the plugin's own switch; a full name (`teamPlans`) for any. */
866
+ has(name: string): Promise<boolean>;
867
+ all(): Promise<Record<string, boolean>>;
868
+ };
848
869
  log: {
849
870
  info(...args: unknown[]): void;
850
871
  warn(...args: unknown[]): void;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The feature flags of the core: the parts that ship in the code but are not on for everyone
3
+ * yet (`release`), and the parts a plan includes (`plan`). This file is the list – add a flag
4
+ * here, branch on it with `useFeature("name")` in the studio or `feature("name")` in the
5
+ * runtime, and delete it with its branches once its default became `true`.
6
+ *
7
+ * How a flag gets its value (defaults here → `FEATURES` env → the Manage-App → the `.features`
8
+ * file) lives in features.ts. A plugin's flags are declared in its manifest under `features`
9
+ * and are known as `<plugin id>.<name>`; they do not belong here. No public page lists these.
10
+ */
11
+ export interface FeatureDeclaration {
12
+ kind: "release" | "plan";
13
+ /** What counts until a layer says otherwise. */
14
+ default: boolean;
15
+ /** A few words for the lists: `wizards features`, the admin's switches. */
16
+ label: string;
17
+ hint?: string;
18
+ }
19
+ /**
20
+ * One entry per flag. `kind: "release"`: on or off for everyone by default, turned on for a
21
+ * team or a machine before the default flips. `kind: "plan"`: on until a plan says `false`.
22
+ */
23
+ export declare const FEATURES: {
24
+ readonly account: {
25
+ readonly kind: "release";
26
+ readonly default: true;
27
+ readonly label: "Account in a local install";
28
+ readonly hint: "Linking, Settings → Account, the offer to sign in.";
29
+ };
30
+ readonly unsetConnectors: {
31
+ readonly kind: "release";
32
+ readonly default: false;
33
+ readonly label: "Connectors without an OAuth client";
34
+ readonly hint: "Built-in connectors are shown although their client is not set up.";
35
+ };
36
+ readonly site: {
37
+ readonly kind: "release";
38
+ readonly default: false;
39
+ readonly label: "Link to the website in the setup";
40
+ readonly hint: "The local install's setup links the product's site.";
41
+ };
42
+ readonly teamPlans: {
43
+ readonly kind: "release";
44
+ readonly default: false;
45
+ readonly label: "Team plans";
46
+ readonly hint: "The team page in the cloud studio, and plans that carry this switch on the account pages.";
47
+ };
48
+ readonly ownKeys: {
49
+ readonly kind: "plan";
50
+ readonly default: true;
51
+ readonly label: "Own API keys";
52
+ readonly hint: "The team puts its providers' keys into the cloud studio instead of running on credits.";
53
+ };
54
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The feature flags of the core: the parts that ship in the code but are not on for everyone
3
+ * yet (`release`), and the parts a plan includes (`plan`). This file is the list – add a flag
4
+ * here, branch on it with `useFeature("name")` in the studio or `feature("name")` in the
5
+ * runtime, and delete it with its branches once its default became `true`.
6
+ *
7
+ * How a flag gets its value (defaults here → `FEATURES` env → the Manage-App → the `.features`
8
+ * file) lives in features.ts. A plugin's flags are declared in its manifest under `features`
9
+ * and are known as `<plugin id>.<name>`; they do not belong here. No public page lists these.
10
+ */
11
+ /**
12
+ * One entry per flag. `kind: "release"`: on or off for everyone by default, turned on for a
13
+ * team or a machine before the default flips. `kind: "plan"`: on until a plan says `false`.
14
+ */
15
+ export const FEATURES = {
16
+ account: {
17
+ kind: "release",
18
+ default: true,
19
+ label: "Account in a local install",
20
+ hint: "Linking, Settings → Account, the offer to sign in.",
21
+ },
22
+ unsetConnectors: {
23
+ kind: "release",
24
+ default: false,
25
+ label: "Connectors without an OAuth client",
26
+ hint: "Built-in connectors are shown although their client is not set up.",
27
+ },
28
+ site: {
29
+ kind: "release",
30
+ default: false,
31
+ label: "Link to the website in the setup",
32
+ hint: "The local install's setup links the product's site.",
33
+ },
34
+ teamPlans: {
35
+ kind: "release",
36
+ default: false,
37
+ label: "Team plans",
38
+ hint: "The team page in the cloud studio, and plans that carry this switch on the account pages.",
39
+ },
40
+ ownKeys: {
41
+ kind: "plan",
42
+ default: true,
43
+ label: "Own API keys",
44
+ hint: "The team puts its providers' keys into the cloud studio instead of running on credits.",
45
+ },
46
+ };
@@ -0,0 +1,36 @@
1
+ import { FEATURES, type FeatureDeclaration } from "./feature-flags.js";
2
+ /**
3
+ * Feature switches: how a flag of feature-flags.ts (or a plugin's manifest) gets its value.
4
+ * The runtime resolves them from the defaults, what the Manage-App says for the team or the
5
+ * linked account, and this install's `.features` file; the studio and plugins read the result.
6
+ */
7
+ export { FEATURES, type FeatureDeclaration };
8
+ export type FeatureName = keyof typeof FEATURES;
9
+ export type FeatureKind = (typeof FEATURES)[FeatureName]["kind"];
10
+ /** A switch by name; a plugin's own switches carry its id: `contacts.leadScoring`. */
11
+ export type Features = Record<string, boolean>;
12
+ /** `teamPlans`, `contacts.leadScoring`. */
13
+ export declare const FEATURE_NAME: RegExp;
14
+ export declare const FEATURE_NAMES: FeatureName[];
15
+ /** What a manifest declares for one switch; what is left out is a release switch, off, named by its key. */
16
+ export interface FeatureDeclarationInput {
17
+ kind?: "release" | "plan";
18
+ default?: boolean;
19
+ label?: string;
20
+ hint?: string;
21
+ }
22
+ /** A plugin's declarations under its id: `contacts` + `leadScoring` → `contacts.leadScoring`. */
23
+ export declare function declaredByPlugin(pluginId: string, features: Record<string, FeatureDeclarationInput | boolean> | undefined): Record<string, FeatureDeclaration>;
24
+ /** The defaults of these declarations; without any, the core's. */
25
+ export declare function defaultFeatures(declared?: Record<string, FeatureDeclaration>): Features;
26
+ /**
27
+ * Switches in the shape of a `.env` file: one `name=on` or `name=off` per line (`true`/`false`
28
+ * and `1`/`0` count too), `#` starts a comment, anything else is skipped. The `FEATURES`
29
+ * environment variable holds the same, comma-separated. Unknown names are kept: a plugin's
30
+ * switches are not known here.
31
+ */
32
+ export declare function parseFeatures(text: string): Features;
33
+ /** The text of a `.features` file for these switches, one `name=on|off` per line. */
34
+ export declare function formatFeatures(features: Features): string;
35
+ /** Layers laid over each other, the last one winning; null layers are skipped. */
36
+ export declare function resolveFeatures(...layers: (Features | null | undefined)[]): Features;
@@ -0,0 +1,78 @@
1
+ import { FEATURES } from "./feature-flags.js";
2
+ /**
3
+ * Feature switches: how a flag of feature-flags.ts (or a plugin's manifest) gets its value.
4
+ * The runtime resolves them from the defaults, what the Manage-App says for the team or the
5
+ * linked account, and this install's `.features` file; the studio and plugins read the result.
6
+ */
7
+ export { FEATURES };
8
+ /** `teamPlans`, `contacts.leadScoring`. */
9
+ export const FEATURE_NAME = /^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)?$/;
10
+ export const FEATURE_NAMES = Object.keys(FEATURES);
11
+ /** A plugin's declarations under its id: `contacts` + `leadScoring` → `contacts.leadScoring`. */
12
+ export function declaredByPlugin(pluginId, features) {
13
+ const out = {};
14
+ for (const [key, raw] of Object.entries(features ?? {})) {
15
+ const name = `${pluginId}.${key}`;
16
+ if (!FEATURE_NAME.test(name)) {
17
+ continue;
18
+ }
19
+ const d = typeof raw === "boolean" ? { default: raw } : raw;
20
+ out[name] = {
21
+ kind: d.kind ?? "release",
22
+ default: d.default ?? false,
23
+ label: d.label ?? key,
24
+ ...(d.hint ? { hint: d.hint } : {}),
25
+ };
26
+ }
27
+ return out;
28
+ }
29
+ /** The defaults of these declarations; without any, the core's. */
30
+ export function defaultFeatures(declared = FEATURES) {
31
+ const out = {};
32
+ for (const [name, d] of Object.entries(declared)) {
33
+ out[name] = d.default;
34
+ }
35
+ return out;
36
+ }
37
+ /**
38
+ * Switches in the shape of a `.env` file: one `name=on` or `name=off` per line (`true`/`false`
39
+ * and `1`/`0` count too), `#` starts a comment, anything else is skipped. The `FEATURES`
40
+ * environment variable holds the same, comma-separated. Unknown names are kept: a plugin's
41
+ * switches are not known here.
42
+ */
43
+ export function parseFeatures(text) {
44
+ const out = {};
45
+ for (const raw of text.split(/[\n,]/)) {
46
+ const line = raw.replace(/#.*$/, "").trim();
47
+ if (!line) {
48
+ continue;
49
+ }
50
+ const m = /^([A-Za-z0-9.]+)\s*=\s*(\S+)$/.exec(line);
51
+ if (!m?.[1] || !m[2] || !FEATURE_NAME.test(m[1])) {
52
+ continue;
53
+ }
54
+ const value = m[2].toLowerCase();
55
+ if (["on", "true", "1"].includes(value)) {
56
+ out[m[1]] = true;
57
+ }
58
+ else if (["off", "false", "0"].includes(value)) {
59
+ out[m[1]] = false;
60
+ }
61
+ }
62
+ return out;
63
+ }
64
+ /** The text of a `.features` file for these switches, one `name=on|off` per line. */
65
+ export function formatFeatures(features) {
66
+ const lines = Object.entries(features).map(([name, on]) => `${name}=${on ? "on" : "off"}`);
67
+ return lines.length ? `${lines.join("\n")}\n` : "";
68
+ }
69
+ /** Layers laid over each other, the last one winning; null layers are skipped. */
70
+ export function resolveFeatures(...layers) {
71
+ const out = {};
72
+ for (const layer of layers) {
73
+ if (layer) {
74
+ Object.assign(out, layer);
75
+ }
76
+ }
77
+ return out;
78
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wizards",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "homepage": "https://engenty.ai",