@adecore/intelligent-ui 0.27.5 → 0.29.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/catalog.d.ts +11 -1
- package/dist/catalog.js +8 -1
- package/dist/fallback.js +2 -0
- package/dist/text.js +1 -1
- package/package.json +1 -1
- package/src/catalog.ts +8 -1
- package/src/fallback.ts +2 -0
- package/src/text.ts +1 -1
package/dist/catalog.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare const UI_GROUPS: {
|
|
|
23
23
|
};
|
|
24
24
|
readonly content: {
|
|
25
25
|
readonly description: 'Include code, attachments and sources.';
|
|
26
|
-
readonly rules: 'Image accepts a chat attachment or generated="latest", never a URL or a local path. Gallery and Compare take chat attachments too. The host says how to attach a file of your own.';
|
|
26
|
+
readonly rules: 'Image accepts a chat attachment or generated="latest", never a URL or a local path. Gallery and Compare take chat attachments too. Model takes a chat attachment of a model file, and is shown only when the person asks to see a model, never on your own after writing or changing one. The host says how to attach a file of your own.';
|
|
27
27
|
};
|
|
28
28
|
readonly places: {
|
|
29
29
|
readonly description: 'Show places on a map the host draws.';
|
|
@@ -291,6 +291,16 @@ export declare const UI_CATALOG: {
|
|
|
291
291
|
}, z.core.$strict>;
|
|
292
292
|
readonly text: 'caption';
|
|
293
293
|
};
|
|
294
|
+
readonly Model: {
|
|
295
|
+
readonly group: 'content';
|
|
296
|
+
readonly description: 'A 3D model from a chat attachment that a person can orbit and zoom; children are the caption.';
|
|
297
|
+
readonly schema: z.ZodObject<{
|
|
298
|
+
attachment: z.ZodString;
|
|
299
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
readonly needs: 'attachment';
|
|
302
|
+
readonly text: 'caption';
|
|
303
|
+
};
|
|
294
304
|
readonly Map: {
|
|
295
305
|
readonly group: 'places';
|
|
296
306
|
readonly description: 'One to 50 places on a map the host draws, with a numbered list under it; bind value to let a person pick a place.';
|
package/dist/catalog.js
CHANGED
|
@@ -15,7 +15,7 @@ export const UI_GROUPS = {
|
|
|
15
15
|
structure: { description: 'Organize distinct topics.', rules: 'Use Tabs for alternatives and Sections for independent topics.' },
|
|
16
16
|
content: {
|
|
17
17
|
description: 'Include code, attachments and sources.',
|
|
18
|
-
rules: 'Image accepts a chat attachment or generated="latest", never a URL or a local path. Gallery and Compare take chat attachments too. The host says how to attach a file of your own.'
|
|
18
|
+
rules: 'Image accepts a chat attachment or generated="latest", never a URL or a local path. Gallery and Compare take chat attachments too. Model takes a chat attachment of a model file, and is shown only when the person asks to see a model, never on your own after writing or changing one. The host says how to attach a file of your own.'
|
|
19
19
|
},
|
|
20
20
|
places: {
|
|
21
21
|
description: 'Show places on a map the host draws.',
|
|
@@ -113,6 +113,13 @@ export const UI_CATALOG = {
|
|
|
113
113
|
schema: z.strictObject({ before: name, after: name, beforeLabel: text.optional(), afterLabel: text.optional() }),
|
|
114
114
|
text: 'caption'
|
|
115
115
|
},
|
|
116
|
+
Model: {
|
|
117
|
+
group: 'content',
|
|
118
|
+
description: 'A 3D model from a chat attachment that a person can orbit and zoom; children are the caption.',
|
|
119
|
+
schema: z.strictObject({ attachment: name, alt: text.optional() }),
|
|
120
|
+
needs: 'attachment',
|
|
121
|
+
text: 'caption'
|
|
122
|
+
},
|
|
116
123
|
Map: {
|
|
117
124
|
group: 'places',
|
|
118
125
|
description: 'One to 50 places on a map the host draws, with a numbered list under it; bind value to let a person pick a place.',
|
package/dist/fallback.js
CHANGED
|
@@ -54,6 +54,8 @@ export function uiNodeFallback(type, props, children) {
|
|
|
54
54
|
return children;
|
|
55
55
|
case 'Image':
|
|
56
56
|
return `[Image: ${uiPlainText(props.alt ?? props.attachment ?? props.generated ?? 'unavailable')}]${children}\n`;
|
|
57
|
+
case 'Model':
|
|
58
|
+
return `[Model: ${uiPlainText(props.alt ?? props.attachment ?? 'unavailable')}]${children.trim() ? ` ${children.trim()}` : ''}\n`;
|
|
57
59
|
}
|
|
58
60
|
const path = given(props.path) && given(props.line) ? `${uiPlainText(props.path)}:${uiPlainText(props.line)}` : props.path;
|
|
59
61
|
const target = path ?? props.sha ?? (type === 'Node' ? props.id : undefined);
|
package/dist/text.js
CHANGED
|
@@ -34,7 +34,7 @@ function uiGroupNames(detailHint) {
|
|
|
34
34
|
}
|
|
35
35
|
export function uiSessionNote({ fenceLanguage = UI_FENCE_LANGUAGE, catalog = 'props', detailHint } = {}) {
|
|
36
36
|
const components = catalog === 'names' ? uiGroupNames(detailHint) : `Catalog (? means optional props): ${uiCompactCatalog()}`;
|
|
37
|
-
return `${uiSyntax(fenceLanguage)} Prose outside. Only named catalog props, no styling. $name = literal JSON; input value={$name}; Button action={@Set($name, literal)}, {@Reset($name)} or {@Reset()} changes local state only; braced expressions: @Count, @Filter(list,row,predicate), @Sum, @Join, @Round. Show/Each control children. Choices are shortcuts after finished work that the person may ignore. When your turn would end waiting on the person (a missing fact, a decision, a go-ahead for work you would otherwise do), ask with your own question tool if you have one, otherwise in prose, never with Choices. Choice labels and precise context stay visible and send once. Image: attachment or generated="latest", never URL/path. No code execution. State resets on reload. ${components}\nExample:\n${uiExample(fenceLanguage)}\n`;
|
|
37
|
+
return `${uiSyntax(fenceLanguage)} Prose outside. Only named catalog props, no styling. $name = literal JSON; input value={$name}; Button action={@Set($name, literal)}, {@Reset($name)} or {@Reset()} changes local state only; braced expressions: @Count, @Filter(list,row,predicate), @Sum, @Join, @Round. Show/Each control children. Choices are shortcuts after finished work that the person may ignore. When your turn would end waiting on the person (a missing fact, a decision, a go-ahead for work you would otherwise do), ask with your own question tool if you have one, otherwise in prose, never with Choices. Choice labels and precise context stay visible and send once. Image: attachment or generated="latest", never URL/path. Model only when the person asks to see one. No code execution. State resets on reload. ${components}\nExample:\n${uiExample(fenceLanguage)}\n`;
|
|
38
38
|
}
|
|
39
39
|
/* One group as the reference writes it: its description and rules, then every component with its props. */
|
|
40
40
|
export function uiGroupReference(group) {
|
package/package.json
CHANGED
package/src/catalog.ts
CHANGED
|
@@ -19,7 +19,7 @@ export const UI_GROUPS = {
|
|
|
19
19
|
structure: { description: 'Organize distinct topics.', rules: 'Use Tabs for alternatives and Sections for independent topics.' },
|
|
20
20
|
content: {
|
|
21
21
|
description: 'Include code, attachments and sources.',
|
|
22
|
-
rules: 'Image accepts a chat attachment or generated="latest", never a URL or a local path. Gallery and Compare take chat attachments too. The host says how to attach a file of your own.'
|
|
22
|
+
rules: 'Image accepts a chat attachment or generated="latest", never a URL or a local path. Gallery and Compare take chat attachments too. Model takes a chat attachment of a model file, and is shown only when the person asks to see a model, never on your own after writing or changing one. The host says how to attach a file of your own.'
|
|
23
23
|
},
|
|
24
24
|
places: {
|
|
25
25
|
description: 'Show places on a map the host draws.',
|
|
@@ -119,6 +119,13 @@ export const UI_CATALOG = {
|
|
|
119
119
|
schema: z.strictObject({ before: name, after: name, beforeLabel: text.optional(), afterLabel: text.optional() }),
|
|
120
120
|
text: 'caption'
|
|
121
121
|
},
|
|
122
|
+
Model: {
|
|
123
|
+
group: 'content',
|
|
124
|
+
description: 'A 3D model from a chat attachment that a person can orbit and zoom; children are the caption.',
|
|
125
|
+
schema: z.strictObject({ attachment: name, alt: text.optional() }),
|
|
126
|
+
needs: 'attachment',
|
|
127
|
+
text: 'caption'
|
|
128
|
+
},
|
|
122
129
|
Map: {
|
|
123
130
|
group: 'places',
|
|
124
131
|
description: 'One to 50 places on a map the host draws, with a numbered list under it; bind value to let a person pick a place.',
|
package/src/fallback.ts
CHANGED
|
@@ -56,6 +56,8 @@ export function uiNodeFallback(type: string, props: Readonly<Record<string, unkn
|
|
|
56
56
|
return children;
|
|
57
57
|
case 'Image':
|
|
58
58
|
return `[Image: ${uiPlainText(props.alt ?? props.attachment ?? props.generated ?? 'unavailable')}]${children}\n`;
|
|
59
|
+
case 'Model':
|
|
60
|
+
return `[Model: ${uiPlainText(props.alt ?? props.attachment ?? 'unavailable')}]${children.trim() ? ` ${children.trim()}` : ''}\n`;
|
|
59
61
|
}
|
|
60
62
|
const path = given(props.path) && given(props.line) ? `${uiPlainText(props.path)}:${uiPlainText(props.line)}` : props.path;
|
|
61
63
|
const target = path ?? props.sha ?? (type === 'Node' ? props.id : undefined);
|
package/src/text.ts
CHANGED
|
@@ -52,7 +52,7 @@ function uiGroupNames(detailHint: string | undefined): string {
|
|
|
52
52
|
|
|
53
53
|
export function uiSessionNote({ fenceLanguage = UI_FENCE_LANGUAGE, catalog = 'props', detailHint }: UiTextOptions = {}): string {
|
|
54
54
|
const components = catalog === 'names' ? uiGroupNames(detailHint) : `Catalog (? means optional props): ${uiCompactCatalog()}`;
|
|
55
|
-
return `${uiSyntax(fenceLanguage)} Prose outside. Only named catalog props, no styling. $name = literal JSON; input value={$name}; Button action={@Set($name, literal)}, {@Reset($name)} or {@Reset()} changes local state only; braced expressions: @Count, @Filter(list,row,predicate), @Sum, @Join, @Round. Show/Each control children. Choices are shortcuts after finished work that the person may ignore. When your turn would end waiting on the person (a missing fact, a decision, a go-ahead for work you would otherwise do), ask with your own question tool if you have one, otherwise in prose, never with Choices. Choice labels and precise context stay visible and send once. Image: attachment or generated="latest", never URL/path. No code execution. State resets on reload. ${components}\nExample:\n${uiExample(fenceLanguage)}\n`;
|
|
55
|
+
return `${uiSyntax(fenceLanguage)} Prose outside. Only named catalog props, no styling. $name = literal JSON; input value={$name}; Button action={@Set($name, literal)}, {@Reset($name)} or {@Reset()} changes local state only; braced expressions: @Count, @Filter(list,row,predicate), @Sum, @Join, @Round. Show/Each control children. Choices are shortcuts after finished work that the person may ignore. When your turn would end waiting on the person (a missing fact, a decision, a go-ahead for work you would otherwise do), ask with your own question tool if you have one, otherwise in prose, never with Choices. Choice labels and precise context stay visible and send once. Image: attachment or generated="latest", never URL/path. Model only when the person asks to see one. No code execution. State resets on reload. ${components}\nExample:\n${uiExample(fenceLanguage)}\n`;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/* One group as the reference writes it: its description and rules, then every component with its props. */
|