@fnndsc/menu 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pacs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pacs.js","sourceRoot":"","sources":["../src/pacs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,sEAAsE;IACtE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,4EAA4E;IAC5E,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,6CAA6C;IAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,sCAAsC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,4EAA4E;IAC5E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,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C7C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CACnC,CAAC,CAAC;AAKH,yCAAyC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAuB,CAAC;AAE/D,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAqB,CAAC"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * @file The plugin vocabulary: a registered plugin as a typed envelope payload.
3
+ *
4
+ * A plugin is the one-node case of the compute graph — everything a pipeline
5
+ * node is, without the pipeline around it. Its substance reached surfaces as
6
+ * a rendered manual for as long as `cat /bin/<plugin>` was the only way to
7
+ * ask, which meant nothing downstream could do anything with it: not a card,
8
+ * not a parameter list, not a form, not an export. This model is that same
9
+ * substance as data; the manual becomes one projection of it.
10
+ *
11
+ * Parameters are the payload that matters. They arrive complete or the model
12
+ * is wrong: a parameter list that quietly stops at a page boundary is worse
13
+ * than the paragraph it replaces, because a paragraph does not look
14
+ * authoritative.
15
+ *
16
+ * @module
17
+ */
18
+ import { z } from 'zod';
19
+ /**
20
+ * One declared parameter of a plugin.
21
+ *
22
+ * `default` is `unknown` because CUBE serves whatever the plugin declared —
23
+ * a string, a number, a boolean, or null for "no default" — and a surface
24
+ * renders it rather than computing on it.
25
+ */
26
+ export declare const pluginParameterSchema: z.ZodObject<{
27
+ name: z.ZodString;
28
+ type: z.ZodString;
29
+ optional: z.ZodBoolean;
30
+ default: z.ZodOptional<z.ZodUnknown>;
31
+ help: z.ZodOptional<z.ZodString>;
32
+ /** The flag as it is typed: `--name`, or the bare name for a positional. */
33
+ flag: z.ZodString;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: string;
36
+ name: string;
37
+ optional: boolean;
38
+ flag: string;
39
+ default?: unknown;
40
+ help?: string | undefined;
41
+ }, {
42
+ type: string;
43
+ name: string;
44
+ optional: boolean;
45
+ flag: string;
46
+ default?: unknown;
47
+ help?: string | undefined;
48
+ }>;
49
+ /**
50
+ * The `plugin.info` model: one registered plugin, whole.
51
+ *
52
+ * Identity, the authoring facts, and every declared parameter. What a
53
+ * surface draws from it — a one-node graph, a parameter table, an argument
54
+ * form — is the surface's business; the model carries no layout and no
55
+ * rendering.
56
+ */
57
+ export declare const pluginInfoModelSchema: z.ZodObject<{
58
+ id: z.ZodOptional<z.ZodNumber>;
59
+ name: z.ZodString;
60
+ version: z.ZodString;
61
+ /** `ds`, `fs`, or `ts` — what the node consumes and produces. */
62
+ type: z.ZodString;
63
+ title: z.ZodOptional<z.ZodString>;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ authors: z.ZodOptional<z.ZodString>;
66
+ /** Where the plugin's source or docs live, when it declared them. */
67
+ documentation: z.ZodOptional<z.ZodString>;
68
+ category: z.ZodOptional<z.ZodString>;
69
+ /**
70
+ * Every declared parameter, in the order CUBE serves them.
71
+ *
72
+ * Complete, always: the builder drains the collection rather than asking
73
+ * for a page and calling it the answer.
74
+ */
75
+ parameters: z.ZodArray<z.ZodObject<{
76
+ name: z.ZodString;
77
+ type: z.ZodString;
78
+ optional: z.ZodBoolean;
79
+ default: z.ZodOptional<z.ZodUnknown>;
80
+ help: z.ZodOptional<z.ZodString>;
81
+ /** The flag as it is typed: `--name`, or the bare name for a positional. */
82
+ flag: z.ZodString;
83
+ }, "strip", z.ZodTypeAny, {
84
+ type: string;
85
+ name: string;
86
+ optional: boolean;
87
+ flag: string;
88
+ default?: unknown;
89
+ help?: string | undefined;
90
+ }, {
91
+ type: string;
92
+ name: string;
93
+ optional: boolean;
94
+ flag: string;
95
+ default?: unknown;
96
+ help?: string | undefined;
97
+ }>, "many">;
98
+ /** The `/bin` entry that runs it, so a surface can lower a click to a command. */
99
+ command: z.ZodOptional<z.ZodString>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ type: string;
102
+ name: string;
103
+ version: string;
104
+ parameters: {
105
+ type: string;
106
+ name: string;
107
+ optional: boolean;
108
+ flag: string;
109
+ default?: unknown;
110
+ help?: string | undefined;
111
+ }[];
112
+ id?: number | undefined;
113
+ title?: string | undefined;
114
+ command?: string | undefined;
115
+ description?: string | undefined;
116
+ authors?: string | undefined;
117
+ documentation?: string | undefined;
118
+ category?: string | undefined;
119
+ }, {
120
+ type: string;
121
+ name: string;
122
+ version: string;
123
+ parameters: {
124
+ type: string;
125
+ name: string;
126
+ optional: boolean;
127
+ flag: string;
128
+ default?: unknown;
129
+ help?: string | undefined;
130
+ }[];
131
+ id?: number | undefined;
132
+ title?: string | undefined;
133
+ command?: string | undefined;
134
+ description?: string | undefined;
135
+ authors?: string | undefined;
136
+ documentation?: string | undefined;
137
+ category?: string | undefined;
138
+ }>;
139
+ export type PluginParameter = z.infer<typeof pluginParameterSchema>;
140
+ export type PluginInfoModel = z.infer<typeof pluginInfoModelSchema>;
141
+ /** The model's envelope kind. */
142
+ export declare const PLUGIN_INFO_MODEL_KIND: "plugin.info";
package/dist/plugin.js ADDED
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @file The plugin vocabulary: a registered plugin as a typed envelope payload.
3
+ *
4
+ * A plugin is the one-node case of the compute graph — everything a pipeline
5
+ * node is, without the pipeline around it. Its substance reached surfaces as
6
+ * a rendered manual for as long as `cat /bin/<plugin>` was the only way to
7
+ * ask, which meant nothing downstream could do anything with it: not a card,
8
+ * not a parameter list, not a form, not an export. This model is that same
9
+ * substance as data; the manual becomes one projection of it.
10
+ *
11
+ * Parameters are the payload that matters. They arrive complete or the model
12
+ * is wrong: a parameter list that quietly stops at a page boundary is worse
13
+ * than the paragraph it replaces, because a paragraph does not look
14
+ * authoritative.
15
+ *
16
+ * @module
17
+ */
18
+ import { z } from 'zod';
19
+ /**
20
+ * One declared parameter of a plugin.
21
+ *
22
+ * `default` is `unknown` because CUBE serves whatever the plugin declared —
23
+ * a string, a number, a boolean, or null for "no default" — and a surface
24
+ * renders it rather than computing on it.
25
+ */
26
+ export const pluginParameterSchema = z.object({
27
+ name: z.string(),
28
+ type: z.string(),
29
+ optional: z.boolean(),
30
+ default: z.unknown().optional(),
31
+ help: z.string().optional(),
32
+ /** The flag as it is typed: `--name`, or the bare name for a positional. */
33
+ flag: z.string(),
34
+ });
35
+ /**
36
+ * The `plugin.info` model: one registered plugin, whole.
37
+ *
38
+ * Identity, the authoring facts, and every declared parameter. What a
39
+ * surface draws from it — a one-node graph, a parameter table, an argument
40
+ * form — is the surface's business; the model carries no layout and no
41
+ * rendering.
42
+ */
43
+ export const pluginInfoModelSchema = z.object({
44
+ id: z.number().optional(),
45
+ name: z.string(),
46
+ version: z.string(),
47
+ /** `ds`, `fs`, or `ts` — what the node consumes and produces. */
48
+ type: z.string(),
49
+ title: z.string().optional(),
50
+ description: z.string().optional(),
51
+ authors: z.string().optional(),
52
+ /** Where the plugin's source or docs live, when it declared them. */
53
+ documentation: z.string().optional(),
54
+ category: z.string().optional(),
55
+ /**
56
+ * Every declared parameter, in the order CUBE serves them.
57
+ *
58
+ * Complete, always: the builder drains the collection rather than asking
59
+ * for a page and calling it the answer.
60
+ */
61
+ parameters: z.array(pluginParameterSchema),
62
+ /** The `/bin` entry that runs it, so a surface can lower a click to a command. */
63
+ command: z.string().optional(),
64
+ });
65
+ /** The model's envelope kind. */
66
+ export const PLUGIN_INFO_MODEL_KIND = 'plugin.info';
67
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,4EAA4E;IAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,iEAAiE;IACjE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,qEAAqE;IACrE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B;;;;;OAKG;IACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;IAC1C,kFAAkF;IAClF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAKH,iCAAiC;AACjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fnndsc/menu",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "The mise wire contract: envelope, session protocol, and result-model schemas that surfaces and the kernel both speak",
5
5
  "repository": {
6
6
  "type": "git",