@vertesia/appgen-docs 1.5.0-dev.20260725.083715Z
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/LICENSE +201 -0
- package/README.md +18 -0
- package/lib/docs/app-package-patterns.md +62 -0
- package/lib/docs/frontend-imports.md +75 -0
- package/lib/docs/handlebars-prompts.md +93 -0
- package/lib/docs/package-dashboards.md +110 -0
- package/lib/docs/package-processes.md +220 -0
- package/lib/docs/package-types.md +80 -0
- package/lib/docs/store-objects.md +94 -0
- package/lib/docs/tool-server-resource.md +397 -0
- package/lib/docs/ui/llms.txt +20 -0
- package/lib/docs/ui-interfaces.d.ts +1284 -0
- package/lib/docs/vertesia-client.d.ts +5644 -0
- package/lib/docs/vertesia-common.d.ts +4404 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Vertesia
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @vertesia/appgen-docs
|
|
2
|
+
|
|
3
|
+
Generated SDK declarations and focused development guidance used by Vertesia app agents.
|
|
4
|
+
|
|
5
|
+
The package build reads the current composableai workspace outputs for `@vertesia/ui`,
|
|
6
|
+
`@vertesia/client`, and `@vertesia/common`, then writes the published documentation under
|
|
7
|
+
`lib/docs/` so the package entrypoint and documentation are restored together from build caches.
|
|
8
|
+
The tool-server resource guide is copied from the plugin template's canonical
|
|
9
|
+
`.agents/skills/vertesia-tool-server-resource/REFERENCE.md` during that build.
|
|
10
|
+
|
|
11
|
+
Consumers can locate the installed documentation with:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { appgenDocsRoot } from '@vertesia/appgen-docs';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The stable `frontend-imports.md` guidance intentionally does not contain a bundled CDN catalog.
|
|
18
|
+
Consumers add the import specifiers exposed by their actual runtime UI deployment.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# App Package Patterns
|
|
2
|
+
|
|
3
|
+
Generated Vertesia apps expose portable capabilities from their service package. The build script writes:
|
|
4
|
+
|
|
5
|
+
- `dist/app-package.json`: full package payload from the built server
|
|
6
|
+
- `dist/app-package-summary.json`: compact runtime package inventory
|
|
7
|
+
- `dist/app-quality-report.json`: source-level quality and artifact inventory
|
|
8
|
+
|
|
9
|
+
Before publish, run the full service build:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm run service:build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For package-only checks during authoring, run:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pnpm run service:build:server
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The output must list the package artifacts. If an expected type, interaction, prompt, process, view, dashboard, template, widget, activity, tool, or seed script is missing from the summary, fix the exports before publishing.
|
|
22
|
+
|
|
23
|
+
## ServerConfig Checklist
|
|
24
|
+
|
|
25
|
+
`src/modules/app/resources/<kind>/index.ts` should export every user-owned collection or definition array. The generated `src/tool-server/app-server-modules.ts` aggregates active modules, and `src/tool-server/config.ts` consumes that generated wiring:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import type { ToolServerConfig } from '@vertesia/tools-sdk';
|
|
29
|
+
import {
|
|
30
|
+
activities,
|
|
31
|
+
dashboards,
|
|
32
|
+
interactions,
|
|
33
|
+
processes,
|
|
34
|
+
skills,
|
|
35
|
+
templates,
|
|
36
|
+
tools,
|
|
37
|
+
types,
|
|
38
|
+
views,
|
|
39
|
+
} from './app-server-modules.js';
|
|
40
|
+
|
|
41
|
+
export const ServerConfig = {
|
|
42
|
+
prefix: '/api',
|
|
43
|
+
tools,
|
|
44
|
+
activities,
|
|
45
|
+
interactions,
|
|
46
|
+
types,
|
|
47
|
+
skills,
|
|
48
|
+
templates,
|
|
49
|
+
dashboards,
|
|
50
|
+
processes,
|
|
51
|
+
views,
|
|
52
|
+
} satisfies ToolServerConfig;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If a capability is authored in source but absent from the package summary, check that:
|
|
56
|
+
|
|
57
|
+
1. the capability collection exports from its own `index.ts`
|
|
58
|
+
2. `src/modules/app/resources/<kind>/index.ts` includes that collection or definition
|
|
59
|
+
3. `src/modules/app/resources/index.ts` re-exports the capability kind
|
|
60
|
+
4. `pnpm run service:build:server` passes
|
|
61
|
+
|
|
62
|
+
Prefer app-owned package artifacts over tenant-local Studio/Zeno DB configuration for product behavior. Runtime/test data belongs in Store objects that use app-owned type refs such as `app:my-app:case`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# App Frontend Imports
|
|
2
|
+
|
|
3
|
+
This file is generated by `@vertesia/appgen-docs`.
|
|
4
|
+
Do not edit it by hand. Update the package generator or the UI package docs instead.
|
|
5
|
+
|
|
6
|
+
Use this reference before adding imports or package dependencies in generated Vertesia apps.
|
|
7
|
+
|
|
8
|
+
## Rules
|
|
9
|
+
|
|
10
|
+
- Prefer the existing template dependencies and the CDN/import-map packages below.
|
|
11
|
+
- Do not manually run `npm install` or `pnpm install` in the app workspace. `app_dev_server_start` owns install and typecheck.
|
|
12
|
+
- Do not add `react-router-dom`; Vertesia apps use `@vertesia/ui/router`.
|
|
13
|
+
- Do not import from bare `@vertesia/ui`; it has no package root export. Use subpath imports.
|
|
14
|
+
- Use public subpath imports only. Never import from generated declaration/source paths such as
|
|
15
|
+
`@vertesia/ui/core/shadcn/*`, `@vertesia/ui/core/toast`, or any path shown in
|
|
16
|
+
`appgen/ui-interfaces.d.ts` section comments.
|
|
17
|
+
- Do not add another UI framework to make guessed component code compile. If an API is uncertain, use `ui/llms.txt` and `appgen/ui-interfaces.d.ts`, or use plain JSX with Tailwind classes.
|
|
18
|
+
- CDN availability only means a library can be imported/bundled. It does not mean it is the right default for generated apps.
|
|
19
|
+
- If a component export is not confirmed, use plain HTML elements with Tailwind classes instead of guessing a shadcn/Radix import.
|
|
20
|
+
- For generated app-level chrome, prefer plain JSX (`<aside>`, `<main>`, `<header>`, `<nav>`) with Tailwind classes over `@vertesia/ui/layout` shell components unless you have checked exact props in `appgen/ui-interfaces.d.ts`.
|
|
21
|
+
|
|
22
|
+
## Vertesia Imports
|
|
23
|
+
|
|
24
|
+
Use these subpaths:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
28
|
+
import { RouterProvider, NavLink, useNavigate, useLocation, useParams } from '@vertesia/ui/router';
|
|
29
|
+
import { Button, Badge, Input, Textarea, Spinner, Modal, ModalTitle, ModalBody, ModalFooter } from '@vertesia/ui/core';
|
|
30
|
+
import { Table, THead, TBody, TR, SelectBox, SelectList, useFetch, useToast } from '@vertesia/ui/core';
|
|
31
|
+
import { GenericPageNavHeader, ModernAgentConversation } from '@vertesia/ui/features';
|
|
32
|
+
import { MarkdownRenderer } from '@vertesia/ui/widgets';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Common pitfalls:
|
|
36
|
+
|
|
37
|
+
- Toasts: `const toast = useToast(); toast({ title: 'Saved' });`. Do not import `toast`.
|
|
38
|
+
- Textarea: `import { Textarea } from '@vertesia/ui/core'`. Do not import from `core/shadcn/textarea`.
|
|
39
|
+
- Selects: use `SelectBox` or `SelectList`; there is no `SelectTrigger`/`SelectItem` export.
|
|
40
|
+
- Tables: use `Table`, `THead`, `TBody`, `TR`; there are no `TableHeader`/`TableRow`/`TableCell` exports.
|
|
41
|
+
- Store search: `client.objects.search(...)` returns `ObjectSearchResponse` with `results`.
|
|
42
|
+
Use `ContentObjectItem`, `ContentObject`, and `ObjectSearchResponse` from `@vertesia/common`;
|
|
43
|
+
do not import `SearchResult`, `DocumentSearchResult`, or `ContentObjectType` from `@vertesia/client`.
|
|
44
|
+
Generated app UI should use `client.objects.search({ query: { type, match }, limit })` for Store reads;
|
|
45
|
+
reserve `objects.find()` and `objects.list()` for platform/debug code, not normal customer app data loading.
|
|
46
|
+
- Vertesia SDK methods must stay attached to their client topic. Do not assign/destructure methods like
|
|
47
|
+
`const search = client.objects.search; await search(...)`; call `await client.objects.search(...)` instead
|
|
48
|
+
so the SDK keeps its request context.
|
|
49
|
+
- Charts: use Vega-based charting (`react-vega`, `vega-lite`, `vega-embed`) for core analytics,
|
|
50
|
+
dashboard pages, and data-exploration views because Vega specs can be wired cleanly to rows from
|
|
51
|
+
Store search, object aggregation, and Data Store queries. Recharts is acceptable only for simple
|
|
52
|
+
non-core visual summaries when the app explicitly includes it as a dependency.
|
|
53
|
+
For React-rendered Vega-Lite charts, use `import { VegaEmbed } from 'react-vega'`; do not import
|
|
54
|
+
`Vega`, `VegaLite`, or `VegaLiteChart` from `react-vega`.
|
|
55
|
+
Render with `<VegaEmbed spec={spec} options={{ actions: false }} />`; do not pass
|
|
56
|
+
`actions={false}` directly because React forwards that unknown prop to the DOM and the design
|
|
57
|
+
renderer treats the resulting console warning as a render failure.
|
|
58
|
+
|
|
59
|
+
## Recommended App Defaults
|
|
60
|
+
|
|
61
|
+
Start with:
|
|
62
|
+
|
|
63
|
+
- `react`, `react-dom`
|
|
64
|
+
- `@vertesia/ui`, `@vertesia/client`, `@vertesia/common`
|
|
65
|
+
- `@vertesia/tools-sdk` and `hono` for service-target apps with package capabilities
|
|
66
|
+
- `lucide-react` for icons
|
|
67
|
+
- `react-vega`, `vega`, `vega-lite`, and `vega-embed` for analytics/dashboard charts backed by Store search or Data Store query rows
|
|
68
|
+
- `react-markdown`, `remark-gfm`, and `rehype-katex` for markdown/document rendering
|
|
69
|
+
- `papaparse`, `xlsx`, or `docx` only when the requested workflow needs file parsing or export
|
|
70
|
+
|
|
71
|
+
## Runtime CDN Imports
|
|
72
|
+
|
|
73
|
+
The documentation synchronizer replaces this section with the import specifiers exposed by the
|
|
74
|
+
actual Vertesia UI deployment used by the app agent. If no catalog appears below, CDN discovery
|
|
75
|
+
failed and package availability must be verified before adding a dependency.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Handlebars Prompts
|
|
2
|
+
|
|
3
|
+
Use this when creating app-owned prompts and interactions in a Vertesia app package.
|
|
4
|
+
|
|
5
|
+
## Rule
|
|
6
|
+
|
|
7
|
+
New app-owned prompts should be Handlebars prompt files. Prefer `.hbs?prompt` files with YAML frontmatter for prompt metadata, then import those prompt definitions into the app's interaction collection.
|
|
8
|
+
|
|
9
|
+
Do not create new JST prompts, plain-text prompt segments, or large inline TypeScript prompt strings unless a tiny dynamic wrapper is unavoidable.
|
|
10
|
+
|
|
11
|
+
Every app-owned agent/system prompt should include current execution time near the top:
|
|
12
|
+
|
|
13
|
+
```handlebars
|
|
14
|
+
Today's date is {{_now}}.
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Helpers
|
|
18
|
+
|
|
19
|
+
Registered Handlebars helpers:
|
|
20
|
+
|
|
21
|
+
| Name | Description | Example |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `_now` | Current ISO timestamp at render time. | `Report generated at {{_now}}` |
|
|
24
|
+
| `stringify` | Converts a value to JSON. Null/undefined become an empty string; strings are returned unchanged. | `Input: {{stringify data}}` |
|
|
25
|
+
|
|
26
|
+
Standard Handlebars block helpers are available:
|
|
27
|
+
|
|
28
|
+
| Name | Description | Example |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `if` / `unless` | Conditional rendering. | `{{#if flag}}Enabled{{else}}Disabled{{/if}}` |
|
|
31
|
+
| `each` | Iterate arrays or objects. | `{{#each items}}- {{this.name}}{{/each}}` |
|
|
32
|
+
| `with` | Change the current evaluation context. | `{{#with user}}{{name}}{{/with}}` |
|
|
33
|
+
|
|
34
|
+
Execution variables:
|
|
35
|
+
|
|
36
|
+
| Name | Description | Example |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `_model` | Model id when injected by the execution runner. It may be absent in preview/render contexts unless supplied as input. | `Model: {{_model}}` |
|
|
39
|
+
|
|
40
|
+
No custom `default` helper is registered. Use an `if`/`else` block:
|
|
41
|
+
|
|
42
|
+
```handlebars
|
|
43
|
+
Priority: {{#if priority}}{{priority}}{{else}}standard{{/if}}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Prompt File Pattern
|
|
47
|
+
|
|
48
|
+
```handlebars
|
|
49
|
+
---
|
|
50
|
+
name: supplier-capa-risk-review
|
|
51
|
+
title: Supplier CAPA Risk Review
|
|
52
|
+
role: user
|
|
53
|
+
content_type: handlebars
|
|
54
|
+
schema:
|
|
55
|
+
type: object
|
|
56
|
+
properties:
|
|
57
|
+
capa_record:
|
|
58
|
+
type: object
|
|
59
|
+
focus:
|
|
60
|
+
type: string
|
|
61
|
+
required: [capa_record]
|
|
62
|
+
---
|
|
63
|
+
Review this supplier CAPA record.
|
|
64
|
+
|
|
65
|
+
Today's date is {{_now}}.
|
|
66
|
+
|
|
67
|
+
Record:
|
|
68
|
+
{{stringify capa_record}}
|
|
69
|
+
|
|
70
|
+
{{#if focus}}
|
|
71
|
+
Focus: {{focus}}
|
|
72
|
+
{{/if}}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Import the prompt definition in TypeScript and include it in the interaction collection:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import reviewPrompt from './prompts/supplier-capa-risk-review.hbs?prompt';
|
|
79
|
+
|
|
80
|
+
export const interactions = new InteractionCollection({
|
|
81
|
+
name: 'supplier-capa',
|
|
82
|
+
interactions: [
|
|
83
|
+
{
|
|
84
|
+
name: 'risk-review',
|
|
85
|
+
title: 'Supplier CAPA Risk Review',
|
|
86
|
+
prompts: [reviewPrompt],
|
|
87
|
+
agent_runner_options: { is_agent: false },
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
For system prompts, keep the `{{_now}}` line in the system prompt itself. User prompts can include it when date-sensitive inputs matter, but system prompts are the default place.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# App Package Dashboards
|
|
2
|
+
|
|
3
|
+
Use this when a Vertesia app contributes analytics dashboards through its service package.
|
|
4
|
+
|
|
5
|
+
This covers how an **app package** registers dashboards. For Vega-Lite spec authoring (mark types, encodings, vconcat/hconcat layout, cross-panel selections), read `data-platform/dashboards.md` — do not duplicate spec details here.
|
|
6
|
+
|
|
7
|
+
## Registering Dashboards
|
|
8
|
+
|
|
9
|
+
App dashboards are `AppDashboardDefinition` objects on `ToolServerConfig.dashboards`. Each is exposed by the host as `app:<app-name>:<id>` and is read-only until a user clones it into a stored dashboard. They render over live Store/Data-Platform data, so there are no per-project dashboard records to seed.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import type { AppDashboardDefinition } from '@vertesia/common';
|
|
13
|
+
import type { ToolServerConfig } from '@vertesia/tools-sdk';
|
|
14
|
+
|
|
15
|
+
export const dashboards: AppDashboardDefinition[] = [
|
|
16
|
+
{
|
|
17
|
+
id: 'claims-by-status',
|
|
18
|
+
title: 'Claims by status',
|
|
19
|
+
description: 'Open vs. resolved claims over the last 30 days.',
|
|
20
|
+
tags: ['claims'],
|
|
21
|
+
// SQL shortcut for dashboards backed by a Data Platform data store.
|
|
22
|
+
query: `
|
|
23
|
+
SELECT status, COUNT(*) AS count
|
|
24
|
+
FROM claims
|
|
25
|
+
WHERE created_at >= {{since}}
|
|
26
|
+
GROUP BY status
|
|
27
|
+
`,
|
|
28
|
+
queryParameters: { since: '2026-05-01' },
|
|
29
|
+
queryLimit: 1000,
|
|
30
|
+
// Vega-Lite spec. The query result is injected as the default data source
|
|
31
|
+
// (data.values) — see data-platform/dashboards.md for spec authoring.
|
|
32
|
+
spec: {
|
|
33
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
34
|
+
mark: 'bar',
|
|
35
|
+
encoding: {
|
|
36
|
+
x: { field: 'status', type: 'nominal' },
|
|
37
|
+
y: { field: 'count', type: 'quantitative' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
] satisfies AppDashboardDefinition[];
|
|
42
|
+
|
|
43
|
+
export const ServerConfig = {
|
|
44
|
+
prefix: '/api',
|
|
45
|
+
dashboards,
|
|
46
|
+
// tools, interactions, types, processes, templates...
|
|
47
|
+
} satisfies ToolServerConfig;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The app package endpoint serializes `ServerConfig.dashboards`:
|
|
51
|
+
|
|
52
|
+
- `GET /api/package?scope=dashboards` returns `{ dashboards: [...] }`.
|
|
53
|
+
- `GET /api/dashboards` lists registered dashboards.
|
|
54
|
+
- `GET /api/dashboards/:id` retrieves by `id`, `name`, or `title`.
|
|
55
|
+
|
|
56
|
+
## Data Sources
|
|
57
|
+
|
|
58
|
+
A dashboard gets its rows from exactly one source. Pick the path that matches the backend:
|
|
59
|
+
|
|
60
|
+
- **Data Platform SQL** — use the `query` shortcut (string) as above, or the explicit form `dataSource: { kind: 'data_sql', query, queryLimit?, queryParameters? }`. SQL is SELECT-only and supports `{{param}}` placeholders; defaults come from `queryParameters`.
|
|
61
|
+
- **Store Elasticsearch DSL** — `dataSource: { kind: 'store_es_dsl', dsl, result? }`. The DSL runs through the secured Store query API (project/security filtering stays server-side). `result` maps the response into Vega rows: `{ type: 'hits' }` (default) or `{ type: 'aggregation_buckets', path, keyField?, countField? }`.
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
{
|
|
65
|
+
id: 'docs-by-type',
|
|
66
|
+
title: 'Documents by type',
|
|
67
|
+
dataSource: {
|
|
68
|
+
kind: 'store_es_dsl',
|
|
69
|
+
dsl: { aggs: { by_type: { terms: { field: 'type' } } }, size: 0 },
|
|
70
|
+
result: { type: 'aggregation_buckets', path: 'by_type', keyField: 'type', countField: 'count' },
|
|
71
|
+
},
|
|
72
|
+
spec: {
|
|
73
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
74
|
+
mark: 'arc',
|
|
75
|
+
encoding: {
|
|
76
|
+
theta: { field: 'count', type: 'quantitative' },
|
|
77
|
+
color: { field: 'type', type: 'nominal' },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Shape
|
|
84
|
+
|
|
85
|
+
`AppDashboardDefinition`:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
interface AppDashboardDefinition {
|
|
89
|
+
id: string; // local app dashboard id; exposed as app:<app-name>:<id>
|
|
90
|
+
name?: string; // defaults to id
|
|
91
|
+
title?: string; // defaults to name or id
|
|
92
|
+
description?: string;
|
|
93
|
+
tags?: string[];
|
|
94
|
+
dataSource?: DashboardDataSource; // DashboardSqlDataSource | DashboardStoreElasticsearchDataSource
|
|
95
|
+
query?: string; // SQL shortcut for data-store-backed dashboards
|
|
96
|
+
queryLimit?: number;
|
|
97
|
+
queryParameters?: Record<string, string>;
|
|
98
|
+
spec?: Record<string, unknown>; // complete Vega-Lite spec
|
|
99
|
+
// Deprecated — do not use in new app packages:
|
|
100
|
+
queries?: DashboardQuery[]; // use a single query/dataSource instead
|
|
101
|
+
panels?: DashboardPanel[]; // use vconcat/hconcat in one spec
|
|
102
|
+
layout?: DashboardLayout; // layout lives in the spec
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Prefer the modern single-source path (`query`/`dataSource` + one Vega-Lite `spec`). The legacy `queries`/`panels`/`layout` fields are deprecated because multiple data sources prevent cross-panel interactivity — express multi-panel layouts with `vconcat`/`hconcat` in a single spec.
|
|
107
|
+
|
|
108
|
+
## App Manifest
|
|
109
|
+
|
|
110
|
+
When publishing a service app that exposes dashboards, ensure the app manifest/capabilities include `dashboards` and publish with `target: "service"`. Studio normalizes app dashboard ids to `app:<app-name>:<id>` when listing installed app dashboards.
|