@docyrus/docyrus 0.0.18 → 0.0.20

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 (52) hide show
  1. package/agent-loader.js +5 -2
  2. package/agent-loader.js.map +2 -2
  3. package/main.js +185 -31
  4. package/main.js.map +2 -2
  5. package/package.json +3 -3
  6. package/resources/pi-agent/prompts/coder-system.md +106 -0
  7. package/resources/pi-agent/skills/docyrus-platform/SKILL.md +71 -0
  8. package/resources/pi-agent/skills/docyrus-platform/references/ai-capabilities.md +43 -0
  9. package/resources/pi-agent/skills/docyrus-platform/references/auth-and-multi-tenancy.md +35 -0
  10. package/resources/pi-agent/skills/docyrus-platform/references/automation-and-workflows.md +30 -0
  11. package/resources/pi-agent/skills/docyrus-platform/references/core-building-blocks.md +53 -0
  12. package/resources/pi-agent/skills/{docyrus-api-dev → docyrus-platform}/references/data-source-query-guide.md +32 -28
  13. package/resources/pi-agent/skills/docyrus-platform/references/developer-tools.md +28 -0
  14. package/resources/pi-agent/skills/docyrus-platform/references/docyrus-cli-usage.md +503 -0
  15. package/resources/pi-agent/skills/{docyrus-api-dev → docyrus-platform}/references/formula-design-guide-llm.md +15 -23
  16. package/resources/pi-agent/skills/docyrus-platform/references/integrations-and-events.md +60 -0
  17. package/resources/pi-agent/skills/docyrus-platform/references/platform-services.md +58 -0
  18. package/resources/pi-agent/skills/docyrus-platform/references/querying-and-data-operations.md +27 -0
  19. package/resources/pi-agent/prompts/coder-append-system.md +0 -19
  20. package/resources/pi-agent/skills/docyrus-ai/SKILL.md +0 -28
  21. package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +0 -161
  22. package/resources/pi-agent/skills/docyrus-api-dev/references/api-client.md +0 -349
  23. package/resources/pi-agent/skills/docyrus-api-dev/references/authentication.md +0 -238
  24. package/resources/pi-agent/skills/docyrus-api-dev/references/query-and-formulas.md +0 -592
  25. package/resources/pi-agent/skills/docyrus-api-doctor/SKILL.md +0 -70
  26. package/resources/pi-agent/skills/docyrus-api-doctor/references/checklist-details.md +0 -588
  27. package/resources/pi-agent/skills/docyrus-app-dev/SKILL.md +0 -159
  28. package/resources/pi-agent/skills/docyrus-app-dev/references/api-client-and-auth.md +0 -275
  29. package/resources/pi-agent/skills/docyrus-app-dev/references/collections-and-patterns.md +0 -352
  30. package/resources/pi-agent/skills/docyrus-app-dev/references/data-source-query-guide.md +0 -2059
  31. package/resources/pi-agent/skills/docyrus-app-dev/references/formula-design-guide-llm.md +0 -320
  32. package/resources/pi-agent/skills/docyrus-app-dev/references/query-guide.md +0 -525
  33. package/resources/pi-agent/skills/docyrus-app-ui-design/SKILL.md +0 -466
  34. package/resources/pi-agent/skills/docyrus-app-ui-design/references/component-selection-guide.md +0 -602
  35. package/resources/pi-agent/skills/docyrus-app-ui-design/references/icon-usage-guide.md +0 -463
  36. package/resources/pi-agent/skills/docyrus-app-ui-design/references/preferred-components-catalog.md +0 -242
  37. package/resources/pi-agent/skills/docyrus-apps/SKILL.md +0 -54
  38. package/resources/pi-agent/skills/docyrus-architect/SKILL.md +0 -174
  39. package/resources/pi-agent/skills/docyrus-architect/references/custom-query-guide.md +0 -410
  40. package/resources/pi-agent/skills/docyrus-architect/references/data-source-query-guide.md +0 -2059
  41. package/resources/pi-agent/skills/docyrus-architect/references/formula-design-guide-llm.md +0 -320
  42. package/resources/pi-agent/skills/docyrus-architect/references/formula-reference.md +0 -145
  43. package/resources/pi-agent/skills/docyrus-auth/SKILL.md +0 -100
  44. package/resources/pi-agent/skills/docyrus-cli-app/SKILL.md +0 -279
  45. package/resources/pi-agent/skills/docyrus-cli-app/references/cli-manifest.md +0 -532
  46. package/resources/pi-agent/skills/docyrus-cli-app/references/list-query-examples.md +0 -248
  47. package/resources/pi-agent/skills/docyrus-curl/SKILL.md +0 -32
  48. package/resources/pi-agent/skills/docyrus-discover/SKILL.md +0 -63
  49. package/resources/pi-agent/skills/docyrus-ds/SKILL.md +0 -95
  50. package/resources/pi-agent/skills/docyrus-env/SKILL.md +0 -21
  51. package/resources/pi-agent/skills/docyrus-studio/SKILL.md +0 -369
  52. package/resources/pi-agent/skills/docyrus-tui/SKILL.md +0 -15
@@ -1,279 +0,0 @@
1
- ---
2
- name: docyrus-cli-app
3
- description: Use the Docyrus CLI (`docyrus`) to interact with the Docyrus platform from the terminal. Use when the user asks to authenticate, list apps, query or manage data records (`ds`), manage dev app data source schema objects (`studio`), send API requests, switch environments, tenants, or accounts, discover tenant OpenAPI specs, or use the Bun-powered terminal UI via `docyrus tui`. Triggers on tasks involving docyrus CLI commands, terminal-based Docyrus operations, `docyrus ds list`, `docyrus studio`, `docyrus discover`, `docyrus auth`, `docyrus env`, `docyrus tui`, or shell-based Docyrus workflows.
4
- ---
5
-
6
- # Docyrus CLI
7
-
8
- Guide for using the `docyrus` CLI to interact with the Docyrus platform from the terminal.
9
-
10
- ## Command Overview
11
-
12
- | Command | Description |
13
- |---------|-------------|
14
- | `docyrus` | Show active environment, current auth context, and help summary |
15
- | `docyrus env list` / `env use` | Manage named environments |
16
- | `docyrus auth login` | Authenticate via OAuth2 device flow or manual tokens |
17
- | `docyrus auth logout` | Logout the active account for the current environment |
18
- | `docyrus auth who` | Show the active user and tenant |
19
- | `docyrus auth accounts list` / `use` | Manage saved user accounts |
20
- | `docyrus auth tenants list` / `use` | Manage saved tenants for a user |
21
- | `docyrus apps list` | List apps from `/v1/apps` |
22
- | `docyrus ds get` | Get data source metadata |
23
- | `docyrus ds list` | Query records with filters, sorting, pagination |
24
- | `docyrus ds create` / `update` / `delete` | Mutate records, including bulk create/update |
25
- | `docyrus studio ...` | CRUD for dev app data sources, fields, and enums |
26
- | `docyrus discover api` | Download tenant OpenAPI spec |
27
- | `docyrus discover namespaces` / `path` / `endpoint` / `entity` / `search` | Explore the downloaded tenant OpenAPI spec |
28
- | `docyrus curl` | Send arbitrary API requests |
29
- | `docyrus tui` | Launch the OpenTUI terminal UI (requires Bun) |
30
-
31
- **See [references/cli-manifest.md](references/cli-manifest.md) for complete command reference with flags and arguments.**
32
-
33
- ## Common Workflows
34
-
35
- ### Settings Scope
36
-
37
- By default, `docyrus` stores settings in a project-local `.docyrus/` folder in the current working directory.
38
-
39
- - Local default: `./.docyrus/`
40
- - Global override: `~/.docyrus/` via `-g` or `--global`
41
- - Tenant OpenAPI cache: `<settings-root>/tenans/<tenantId>/openapi.json`
42
-
43
- Examples:
44
-
45
- ```bash
46
- # Local project settings (default)
47
- docyrus auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631"
48
-
49
- # Force global settings for this run
50
- docyrus -g auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631"
51
- ```
52
-
53
- ### Environments
54
-
55
- The CLI does not use `API_BASE_URL`. It uses saved named environments:
56
-
57
- - `live` (`prod` alias) -> `https://api.docyrus.com`
58
- - `beta` -> `https://beta-api.docyrus.com`
59
- - `alpha` -> `https://alpha-api.docyrus.com`
60
- - `dev` -> `https://localhost:3366`
61
-
62
- Examples:
63
-
64
- ```bash
65
- docyrus
66
- docyrus env list --json
67
- docyrus env use beta --json
68
- ```
69
-
70
- Running `docyrus` without a subcommand returns the active environment, help summary, and current auth `context`.
71
-
72
- ### Authentication
73
-
74
- Device flow login:
75
-
76
- ```bash
77
- docyrus auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631" --json
78
- ```
79
-
80
- Manual token login:
81
-
82
- ```bash
83
- docyrus auth login \
84
- --accessToken "<access-token>" \
85
- --refreshToken "<optional-refresh-token>" \
86
- --clientId "<optional-client-id>" \
87
- --json
88
- ```
89
-
90
- Rules:
91
-
92
- - `--refreshToken` requires `--accessToken`
93
- - if local login omits `--clientId`, the CLI falls back to the saved global client ID when available
94
- - explicit or previously resolved client IDs are saved to config for reuse
95
- - default scopes are hardcoded in the CLI and include `openid`, `email`, `profile`, `offline_access`, `ReadWrite.All`, `User.ReadWrite`, `Users.Read.All`, `Tenant.Read`, `Teams.Read.All`, `DS.ReadWrite.All`, `Docs.ReadWrite.All`, and `Architect.ReadWrite.All`
96
-
97
- Multi-account and multi-tenant workflows:
98
-
99
- ```bash
100
- docyrus auth accounts list --json
101
- docyrus auth accounts use --userId "<user-id>" --json
102
- docyrus auth tenants list --userId "<user-id>" --json
103
- docyrus auth tenants use 1002 --json
104
- docyrus auth tenants use "8d130f7a-4bc4-4be6-a05b-0f8f1b2d93e9" --userId "<user-id>" --json
105
- docyrus auth who --json
106
- ```
107
-
108
- `auth tenants use` takes a positional tenant selector. If it is numeric, the CLI treats it as `tenantNo`; otherwise it must be a UUID tenant ID.
109
-
110
- ### Successful Result Shape
111
-
112
- Every successful command injects a top-level `context` field:
113
-
114
- ```json
115
- {
116
- "data": {},
117
- "context": {
118
- "email": "user@example.com",
119
- "tenantName": "Acme",
120
- "tenantNo": 1002,
121
- "tenantDisplay": "Acme (1002)"
122
- }
123
- }
124
- ```
125
-
126
- If there is no active session, `context` is `null`.
127
-
128
- ### Discover API and Entities
129
-
130
- Discover commands require an active session. Commands other than `discover api` auto-download the OpenAPI spec if it is missing locally.
131
-
132
- ```bash
133
- docyrus discover api --json
134
- docyrus discover namespaces --json
135
- docyrus discover path /v1/users --json
136
- docyrus discover endpoint /v1/users/me --json
137
- docyrus discover endpoint [PUT]/v1/users/me/photo --json
138
- docyrus discover entity UserEntity --json
139
- docyrus discover search users,UserEntity --json
140
- ```
141
-
142
- ### Discover Data Sources
143
-
144
- ```bash
145
- docyrus apps list --json
146
- docyrus ds get crm contacts --json
147
- ```
148
-
149
- ### Query Records (`ds list`)
150
-
151
- Basic listing:
152
-
153
- ```bash
154
- docyrus ds list crm contacts --columns "name, email, phone" --limit 20
155
- ```
156
-
157
- With filters:
158
-
159
- ```bash
160
- docyrus ds list crm contacts \
161
- --columns "name, email" \
162
- --filters '{"rules":[{"field":"status","operator":"=","value":"active"}]}'
163
- ```
164
-
165
- With relation expansion:
166
-
167
- ```bash
168
- docyrus ds list crm contacts \
169
- --columns "name, ...related_account(account_name, account_phone)"
170
- ```
171
-
172
- Date shortcut filter:
173
-
174
- ```bash
175
- docyrus ds list crm tasks --filters '{"rules":[{"field":"created_on","operator":"this_month"}]}'
176
- ```
177
-
178
- **See [references/list-query-examples.md](references/list-query-examples.md) for more filter, sort, pagination, and combined query examples.**
179
-
180
- ### Record Mutations
181
-
182
- Create:
183
-
184
- ```bash
185
- docyrus ds create crm contacts --data '{"name":"Jane Doe","email":"jane@example.com"}'
186
- ```
187
-
188
- Update:
189
-
190
- ```bash
191
- docyrus ds update crm contacts <recordId> --data '{"phone":"+1234567890"}'
192
- ```
193
-
194
- Delete:
195
-
196
- ```bash
197
- docyrus ds delete crm contacts <recordId>
198
- ```
199
-
200
- Batch and file input:
201
-
202
- ```bash
203
- docyrus ds create crm contacts --data '[{"name":"A"},{"name":"B"}]' --json
204
- docyrus ds update crm contacts --data '[{"id":"1","phone":"+111"},{"id":"2","phone":"+222"}]' --json
205
- docyrus ds create crm contacts --from-file ./contacts-create.csv --json
206
- docyrus ds update crm contacts <recordId> --from-file ./contact-update.json --json
207
- ```
208
-
209
- Array payloads route to bulk endpoints and are limited to 50 items per request.
210
-
211
- ### Studio Schema CRUD (`studio`)
212
-
213
- Use `studio` for developer-facing schema operations under `/v1/dev/apps/:app_id/data-sources`.
214
-
215
- ```bash
216
- # Data sources
217
- docyrus studio list-data-sources --appSlug crm --expand fields --json
218
- docyrus studio get-data-source --appSlug crm --dataSourceSlug contacts --json
219
- docyrus studio create-data-source --appSlug crm --title "Contacts" --name "contacts" --slug "contacts" --json
220
- docyrus studio update-data-source --appId <appId> --dataSourceId <dataSourceId> --data '{"title":"Contacts v2"}' --json
221
- docyrus studio delete-data-source --appId <appId> --dataSourceSlug contacts --json
222
- docyrus studio bulk-create-data-sources --appId <appId> --from-file ./data-sources.json --json
223
-
224
- # Fields
225
- docyrus studio list-fields --appSlug crm --dataSourceSlug contacts --json
226
- docyrus studio get-field --appSlug crm --dataSourceSlug contacts --fieldSlug email --json
227
- docyrus studio create-field --appId <appId> --dataSourceId <dataSourceId> --name "Email" --slug "email" --type "text" --json
228
- docyrus studio update-field --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --data '{"name":"Primary Email"}' --json
229
- docyrus studio delete-field --appId <appId> --dataSourceId <dataSourceId> --fieldSlug email --json
230
- docyrus studio create-fields-batch --appId <appId> --dataSourceId <dataSourceId> --data '[{"name":"Status","slug":"status","type":"text"}]' --json
231
- docyrus studio update-fields-batch --appId <appId> --dataSourceId <dataSourceId> --from-file ./fields-update.json --json
232
- docyrus studio delete-fields-batch --appId <appId> --dataSourceId <dataSourceId> --data '["field-1","field-2"]' --json
233
-
234
- # Enums
235
- docyrus studio list-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --json
236
- docyrus studio create-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --data '[{"name":"Open","sortOrder":1}]' --json
237
- docyrus studio update-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --from-file ./enums-update.json --json
238
- docyrus studio delete-enums --appId <appId> --dataSourceId <dataSourceId> --fieldId <fieldId> --data '["enum-1","enum-2"]' --json
239
- ```
240
-
241
- ### Arbitrary API Calls
242
-
243
- ```bash
244
- docyrus curl /v1/users/me
245
- docyrus curl /v1/apps -X GET --format json
246
- docyrus curl /v1/some/endpoint -X POST -d '{"key":"value"}'
247
- ```
248
-
249
- ### Terminal UI
250
-
251
- Launch the OpenTUI interface:
252
-
253
- ```bash
254
- docyrus tui
255
- ```
256
-
257
- It requires Bun installed locally. The TUI reuses the existing CLI command graph.
258
-
259
- ## Key Rules
260
-
261
- - Settings are project-local by default in `./.docyrus/`; use `-g` or `--global` for `~/.docyrus/`
262
- - The CLI uses named environments, not `API_BASE_URL`
263
- - `apps list` uses `/v1/apps`
264
- - `ds` commands use `appSlug` and `dataSourceSlug`
265
- - `ds create` and `ds update` accept `--data` JSON or `--from-file` (`.json` or `.csv`), but not both
266
- - Array payloads use bulk endpoints with a maximum of 50 items
267
- - Bulk update requires `id` in every item and must not include positional `<recordId>`
268
- - `--filters` accepts a JSON filter group such as `{"combinator":"and","rules":[...]}`
269
- - Related-field filters use `rel_<relation_slug>/<field_slug>`
270
- - `--columns` supports relation expansion `()`, spread `...`, aliasing `:`, and functions `@`
271
- - `--format` supports `toon`, `json`, `yaml`, `md`, and `jsonl`
272
- - Successful responses inject `context` with `email`, `tenantName`, `tenantNo`, and `tenantDisplay`
273
- - Studio selectors are exclusive pairs: exactly one of `--appId|--appSlug`, `--dataSourceId|--dataSourceSlug`, and `--fieldId|--fieldSlug` as required
274
- - Studio write commands accept `--data` or `--from-file` (JSON only), and explicit flags override overlapping JSON keys
275
-
276
- ## References
277
-
278
- - **[CLI Manifest](references/cli-manifest.md)** — Complete command reference with flags, arguments, and command notes.
279
- - **[List Query Examples](references/list-query-examples.md)** — Practical `ds list` examples covering columns, filters, sorting, pagination, and combined queries.