@docyrus/docyrus 0.0.19 → 0.0.21

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 (111) hide show
  1. package/agent-loader.js +37 -3
  2. package/agent-loader.js.map +2 -2
  3. package/main.js +498 -93
  4. package/main.js.map +4 -4
  5. package/package.json +14 -4
  6. package/resources/chrome-tools/browser-content.js +103 -0
  7. package/resources/chrome-tools/browser-cookies.js +35 -0
  8. package/resources/chrome-tools/browser-eval.js +53 -0
  9. package/resources/chrome-tools/browser-hn-scraper.js +108 -0
  10. package/resources/chrome-tools/browser-nav.js +44 -0
  11. package/resources/chrome-tools/browser-pick.js +162 -0
  12. package/resources/chrome-tools/browser-screenshot.js +34 -0
  13. package/resources/chrome-tools/browser-start.js +86 -0
  14. package/resources/pi-agent/extensions/answer.ts +532 -0
  15. package/resources/pi-agent/extensions/context.ts +578 -0
  16. package/resources/pi-agent/extensions/control.ts +1779 -0
  17. package/resources/pi-agent/extensions/diff.ts +218 -0
  18. package/resources/pi-agent/extensions/files.ts +199 -0
  19. package/resources/pi-agent/extensions/loop.ts +446 -0
  20. package/resources/pi-agent/extensions/multi-edit.ts +835 -0
  21. package/resources/pi-agent/extensions/notify.ts +88 -0
  22. package/resources/pi-agent/extensions/pi-mcp-adapter/CHANGELOG.md +192 -0
  23. package/resources/pi-agent/extensions/pi-mcp-adapter/LICENSE +21 -0
  24. package/resources/pi-agent/extensions/pi-mcp-adapter/README.md +296 -0
  25. package/resources/pi-agent/extensions/pi-mcp-adapter/app-bridge.bundle.js +67 -0
  26. package/resources/pi-agent/extensions/pi-mcp-adapter/cli.js +108 -0
  27. package/resources/pi-agent/extensions/pi-mcp-adapter/commands.ts +211 -0
  28. package/resources/pi-agent/extensions/pi-mcp-adapter/config.ts +227 -0
  29. package/resources/pi-agent/extensions/pi-mcp-adapter/consent-manager.ts +64 -0
  30. package/resources/pi-agent/extensions/pi-mcp-adapter/direct-tools.ts +301 -0
  31. package/resources/pi-agent/extensions/pi-mcp-adapter/errors.ts +219 -0
  32. package/resources/pi-agent/extensions/pi-mcp-adapter/glimpse-ui.ts +80 -0
  33. package/resources/pi-agent/extensions/pi-mcp-adapter/host-html-template.ts +427 -0
  34. package/resources/pi-agent/extensions/pi-mcp-adapter/index.ts +232 -0
  35. package/resources/pi-agent/extensions/pi-mcp-adapter/init.ts +319 -0
  36. package/resources/pi-agent/extensions/pi-mcp-adapter/lifecycle.ts +93 -0
  37. package/resources/pi-agent/extensions/pi-mcp-adapter/logger.ts +169 -0
  38. package/resources/pi-agent/extensions/pi-mcp-adapter/mcp-panel.ts +713 -0
  39. package/resources/pi-agent/extensions/pi-mcp-adapter/metadata-cache.ts +191 -0
  40. package/resources/pi-agent/extensions/pi-mcp-adapter/npx-resolver.ts +419 -0
  41. package/resources/pi-agent/extensions/pi-mcp-adapter/oauth-handler.ts +56 -0
  42. package/resources/pi-agent/extensions/pi-mcp-adapter/package.json +85 -0
  43. package/resources/pi-agent/extensions/pi-mcp-adapter/paths.ts +29 -0
  44. package/resources/pi-agent/extensions/pi-mcp-adapter/proxy-modes.ts +635 -0
  45. package/resources/pi-agent/extensions/pi-mcp-adapter/resource-tools.ts +17 -0
  46. package/resources/pi-agent/extensions/pi-mcp-adapter/server-manager.ts +330 -0
  47. package/resources/pi-agent/extensions/pi-mcp-adapter/state.ts +41 -0
  48. package/resources/pi-agent/extensions/pi-mcp-adapter/tool-metadata.ts +144 -0
  49. package/resources/pi-agent/extensions/pi-mcp-adapter/tool-registrar.ts +46 -0
  50. package/resources/pi-agent/extensions/pi-mcp-adapter/types.ts +367 -0
  51. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-resource-handler.ts +145 -0
  52. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-server.ts +623 -0
  53. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-session.ts +384 -0
  54. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-stream-types.ts +89 -0
  55. package/resources/pi-agent/extensions/pi-mcp-adapter/utils.ts +75 -0
  56. package/resources/pi-agent/extensions/prompt-editor.ts +1315 -0
  57. package/resources/pi-agent/extensions/prompt-url-widget.ts +158 -0
  58. package/resources/pi-agent/extensions/redraws.ts +24 -0
  59. package/resources/pi-agent/extensions/review.ts +2160 -0
  60. package/resources/pi-agent/extensions/todos.ts +2076 -0
  61. package/resources/pi-agent/extensions/tps.ts +47 -0
  62. package/resources/pi-agent/extensions/whimsical.ts +474 -0
  63. package/resources/pi-agent/prompts/coder-system.md +106 -0
  64. package/resources/pi-agent/skills/changelog-generator/SKILL.md +425 -0
  65. package/resources/pi-agent/skills/docyrus-chrome-devtools-cli/SKILL.md +80 -0
  66. package/resources/pi-agent/skills/docyrus-platform/SKILL.md +71 -0
  67. package/resources/pi-agent/skills/docyrus-platform/references/ai-capabilities.md +43 -0
  68. package/resources/pi-agent/skills/docyrus-platform/references/auth-and-multi-tenancy.md +35 -0
  69. package/resources/pi-agent/skills/docyrus-platform/references/automation-and-workflows.md +30 -0
  70. package/resources/pi-agent/skills/docyrus-platform/references/core-building-blocks.md +53 -0
  71. package/resources/pi-agent/skills/{docyrus-api-dev → docyrus-platform}/references/data-source-query-guide.md +32 -28
  72. package/resources/pi-agent/skills/docyrus-platform/references/developer-tools.md +28 -0
  73. package/resources/pi-agent/skills/docyrus-platform/references/docyrus-cli-usage.md +554 -0
  74. package/resources/pi-agent/skills/{docyrus-api-dev → docyrus-platform}/references/formula-design-guide-llm.md +15 -23
  75. package/resources/pi-agent/skills/docyrus-platform/references/integrations-and-events.md +60 -0
  76. package/resources/pi-agent/skills/docyrus-platform/references/platform-services.md +58 -0
  77. package/resources/pi-agent/skills/docyrus-platform/references/querying-and-data-operations.md +27 -0
  78. package/resources/pi-agent/prompts/coder-append-system.md +0 -19
  79. package/resources/pi-agent/skills/docyrus-ai/SKILL.md +0 -28
  80. package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +0 -161
  81. package/resources/pi-agent/skills/docyrus-api-dev/references/api-client.md +0 -349
  82. package/resources/pi-agent/skills/docyrus-api-dev/references/authentication.md +0 -238
  83. package/resources/pi-agent/skills/docyrus-api-dev/references/query-and-formulas.md +0 -592
  84. package/resources/pi-agent/skills/docyrus-api-doctor/SKILL.md +0 -70
  85. package/resources/pi-agent/skills/docyrus-api-doctor/references/checklist-details.md +0 -588
  86. package/resources/pi-agent/skills/docyrus-app-dev/SKILL.md +0 -159
  87. package/resources/pi-agent/skills/docyrus-app-dev/references/api-client-and-auth.md +0 -275
  88. package/resources/pi-agent/skills/docyrus-app-dev/references/collections-and-patterns.md +0 -352
  89. package/resources/pi-agent/skills/docyrus-app-dev/references/data-source-query-guide.md +0 -2059
  90. package/resources/pi-agent/skills/docyrus-app-dev/references/formula-design-guide-llm.md +0 -320
  91. package/resources/pi-agent/skills/docyrus-app-dev/references/query-guide.md +0 -525
  92. package/resources/pi-agent/skills/docyrus-app-ui-design/SKILL.md +0 -466
  93. package/resources/pi-agent/skills/docyrus-app-ui-design/references/component-selection-guide.md +0 -602
  94. package/resources/pi-agent/skills/docyrus-app-ui-design/references/icon-usage-guide.md +0 -463
  95. package/resources/pi-agent/skills/docyrus-app-ui-design/references/preferred-components-catalog.md +0 -242
  96. package/resources/pi-agent/skills/docyrus-apps/SKILL.md +0 -54
  97. package/resources/pi-agent/skills/docyrus-architect/SKILL.md +0 -174
  98. package/resources/pi-agent/skills/docyrus-architect/references/custom-query-guide.md +0 -410
  99. package/resources/pi-agent/skills/docyrus-architect/references/data-source-query-guide.md +0 -2059
  100. package/resources/pi-agent/skills/docyrus-architect/references/formula-design-guide-llm.md +0 -320
  101. package/resources/pi-agent/skills/docyrus-architect/references/formula-reference.md +0 -145
  102. package/resources/pi-agent/skills/docyrus-auth/SKILL.md +0 -100
  103. package/resources/pi-agent/skills/docyrus-cli-app/SKILL.md +0 -279
  104. package/resources/pi-agent/skills/docyrus-cli-app/references/cli-manifest.md +0 -532
  105. package/resources/pi-agent/skills/docyrus-cli-app/references/list-query-examples.md +0 -248
  106. package/resources/pi-agent/skills/docyrus-curl/SKILL.md +0 -32
  107. package/resources/pi-agent/skills/docyrus-discover/SKILL.md +0 -63
  108. package/resources/pi-agent/skills/docyrus-ds/SKILL.md +0 -95
  109. package/resources/pi-agent/skills/docyrus-env/SKILL.md +0 -21
  110. package/resources/pi-agent/skills/docyrus-studio/SKILL.md +0 -369
  111. package/resources/pi-agent/skills/docyrus-tui/SKILL.md +0 -15
@@ -0,0 +1,53 @@
1
+ # Core Building Blocks
2
+
3
+ ## Data Sources
4
+
5
+ Data sources are the fundamental building block. Each data source represents a structured collection of records with a defined schema. Every data source — whether backed by an internal database table or a connected external REST API — is exposed through a single, unified CRUD endpoint. This means consumers interact with all data sources the same way regardless of where the data lives.
6
+
7
+ **Types:**
8
+
9
+ - **Simple** — Schema-flexible records. Quick to set up, ideal for lightweight or rapidly evolving data.
10
+ - **Advanced** — Fully structured data sources with dedicated columns per field. Supports base data sources (shared field inheritance across variants) and high-performance querying.
11
+ - **External** — Connected external REST API resources or databases mapped as data sources. External resources are accessed through the same unified API as internal data sources, abstracting away the underlying connection.
12
+ - **System** — Pre-built templates for common entities: documents, threads, messages, contacts, organizations, activities, tasks, events, calendars, time entries, projects, and sections.
13
+
14
+ **Ownership models:** App-scoped, tenant-custom, product-provided, system-built-in, or user-specific.
15
+
16
+ ## Fields
17
+
18
+ Every data source is composed of fields. 45+ field types cover all data modeling needs:
19
+
20
+ | Category | Field Types |
21
+ |---|---|
22
+ | **Text** | text, textarea, email, phone, URL, color, icon, display |
23
+ | **Rich content** | document editor, HTML editor, email editor, code editor |
24
+ | **Numeric** | number, money, currency, duration, rating, autonumber, identity |
25
+ | **Date & time** | date, dateTime, time, dateRange |
26
+ | **Boolean** | checkbox, switch |
27
+ | **Selection** | select, multiSelect, tagSelect, status, radioGroup |
28
+ | **Users** | userSelect, userMultiSelect |
29
+ | **Relations** | relation (lookup to another data source), list (virtual related records) |
30
+ | **Nested data** | inlineData (nested JSON arrays), inlineForm (nested objects) |
31
+ | **Files** | file, image, fileStorageFolder |
32
+ | **Computed** | formula (JSONata expressions), display (read-only computed) |
33
+ | **Workflow** | approvalStatus, taskList, todo |
34
+ | **Advanced** | json, queryBuilder, dynamic, schema, schemaRepeater, locationSelect |
35
+ | **System** | systemEnum, systemBuffer, systemVector, systemTextArray, systemUuidArray |
36
+
37
+ ## Enumerations
38
+
39
+ Multi-option fields (select, multiSelect, status, tagSelect) support enumerations with color, icon, and ordering. Enum sets allow sharing option lists across multiple fields.
40
+
41
+ ## Apps
42
+
43
+ Apps are the top-level container that groups data sources, views, forms, pages, navigation, and configurations into a deployable unit.
44
+
45
+ **Supported app types:** web, mobile, AI agent, integration, inline (embedded), client portal (web & mobile), Chrome extension, MS Office add-in, MS Outlook add-in, external (white-label), website, and website widget.
46
+
47
+ **App lifecycle:** draft → design → development → active → inactive, with archiving and permanent deletion.
48
+
49
+ **Customization layers:** Apps support per-tenant overrides for pages, views, menus, fields, and enums — allowing product apps to be tailored without forking.
50
+
51
+ ## Custom Queries
52
+
53
+ SQL-based analytics templates with variable interpolation. Support dynamic runtime filters, pagination, and multiple database targets. Built-in variables include tenant context, user identity, and custom filter expressions.
@@ -74,7 +74,7 @@ interface ISelectQueryParams {
74
74
 
75
75
  // --- Aggregation ---
76
76
  calculations?: ISelectQueryCalculationRule[] | null;
77
- showGroupSummaries?: boolean;
77
+ groupSummaries?: boolean;
78
78
 
79
79
  // --- Sorting ---
80
80
  orderBy?: string | ISelectQueryOrderBy | ISelectQueryOrderBy[];
@@ -94,7 +94,7 @@ interface ISelectQueryParams {
94
94
  cursorDateEnd?: string | null;
95
95
 
96
96
  // --- Advanced ---
97
- childQueries?: Record<string, IQueryChildQueryParams> | null;
97
+ childQueries?: ISelectQueryChildQueryParams[] | null;
98
98
  pivot?: {
99
99
  matrix: ISelectPivotMatrixQuery[];
100
100
  hideEmptyRows?: boolean;
@@ -700,7 +700,7 @@ Count unique emails:
700
700
  }
701
701
  ```
702
702
 
703
- ### `showGroupSummaries`
703
+ ### `groupSummaries`
704
704
 
705
705
  **Type:** `boolean`
706
706
  **Default:** `false`
@@ -837,16 +837,14 @@ Block subquery formulas can also be wrapped under an `expression` key:
837
837
  {
838
838
  "formulas": {
839
839
  "children_count": {
840
- "expression": {
841
- "from": "app_child_table",
842
- "with": "parent_field",
843
- "inputs": [{
844
- "kind": "aggregate",
845
- "name": "count",
846
- "distinct": true,
847
- "inputs": [{ "kind": "column", "name": "id" }]
848
- }]
849
- }
840
+ "from": "app_child_table",
841
+ "with": "parent_field",
842
+ "inputs": [{
843
+ "kind": "aggregate",
844
+ "name": "count",
845
+ "distinct": true,
846
+ "inputs": [{ "kind": "column", "name": "id" }]
847
+ }]
850
848
  }
851
849
  }
852
850
  }
@@ -1294,14 +1292,15 @@ interface ISelectPivotMatrixQuery {
1294
1292
 
1295
1293
  ## Child Queries
1296
1294
 
1297
- **Parameter:** `childQueries` — `Record<string, IQueryChildQueryParams> | null`
1295
+ **Parameter:** `childQueries` — `ISelectQueryChildQueryParams[] | null`
1298
1296
 
1299
1297
  Use `childQueries` to fetch related records from a child data source as a nested JSON array for each parent record. This is similar to a `LEFT JOIN` but returns results as an aggregated JSON array in a single column.
1300
1298
 
1301
1299
  ### Child Query Structure
1302
1300
 
1303
1301
  ```typescript
1304
- interface IQueryChildQueryParams {
1302
+ interface ISelectQueryChildQueryParams {
1303
+ alias: string; // alias for the child query
1305
1304
  from: string; // child data source slug in "appSlug_slug" format
1306
1305
  using: string; // field in the child DS that references the parent record
1307
1306
  columns?: string | null; // comma-separated columns to select from child
@@ -1317,8 +1316,9 @@ interface IQueryChildQueryParams {
1317
1316
  ```json
1318
1317
  {
1319
1318
  "columns": "id, name, matters",
1320
- "childQueries": {
1321
- "matters": {
1319
+ "childQueries": [
1320
+ {
1321
+ "alias": "matters",
1322
1322
  "from": "attornaid_matter",
1323
1323
  "using": "client",
1324
1324
  "columns": "name",
@@ -1328,7 +1328,7 @@ interface IQueryChildQueryParams {
1328
1328
  ]
1329
1329
  }
1330
1330
  }
1331
- }
1331
+ ]
1332
1332
  }
1333
1333
  ```
1334
1334
 
@@ -1359,8 +1359,9 @@ interface IQueryChildQueryParams {
1359
1359
  ```json
1360
1360
  {
1361
1361
  "columns": "id, product_name, recent_orders",
1362
- "childQueries": {
1363
- "recent_orders": {
1362
+ "childQueries": [
1363
+ {
1364
+ "alias": "recent_orders",
1364
1365
  "from": "shop_order_item",
1365
1366
  "using": "product",
1366
1367
  "columns": "order_date, quantity, total_price",
@@ -1372,7 +1373,7 @@ interface IQueryChildQueryParams {
1372
1373
  ]
1373
1374
  }
1374
1375
  }
1375
- }
1376
+ ]
1376
1377
  }
1377
1378
  ```
1378
1379
 
@@ -1381,8 +1382,9 @@ interface IQueryChildQueryParams {
1381
1382
  ```json
1382
1383
  {
1383
1384
  "columns": "id, name, order_stats",
1384
- "childQueries": {
1385
- "order_stats": {
1385
+ "childQueries": [
1386
+ {
1387
+ "alias": "order_stats",
1386
1388
  "from": "shop_order",
1387
1389
  "using": "customer",
1388
1390
  "calculations": [
@@ -1390,7 +1392,7 @@ interface IQueryChildQueryParams {
1390
1392
  { "field": "amount", "func": "sum", "name": "total_spent" }
1391
1393
  ]
1392
1394
  }
1393
- }
1395
+ ]
1394
1396
  }
1395
1397
  ```
1396
1398
 
@@ -1769,8 +1771,9 @@ Monthly sales report grouped by category:
1769
1771
  {
1770
1772
  "dataSourceFullSlug": "crm_customer",
1771
1773
  "columns": "id, name, email, recent_orders, open_tickets",
1772
- "childQueries": {
1773
- "recent_orders": {
1774
+ "childQueries": [
1775
+ {
1776
+ "alias": "recent_orders",
1774
1777
  "from": "shop_order",
1775
1778
  "using": "customer",
1776
1779
  "columns": "id, order_date, total_amount, ...status(status_label:name)",
@@ -1782,7 +1785,8 @@ Monthly sales report grouped by category:
1782
1785
  ]
1783
1786
  }
1784
1787
  },
1785
- "open_tickets": {
1788
+ {
1789
+ "alias": "open_tickets",
1786
1790
  "from": "support_ticket",
1787
1791
  "using": "customer",
1788
1792
  "columns": "id, subject, priority, created_on",
@@ -1794,7 +1798,7 @@ Monthly sales report grouped by category:
1794
1798
  ]
1795
1799
  }
1796
1800
  }
1797
- },
1801
+ ],
1798
1802
  "filters": {
1799
1803
  "rules": [
1800
1804
  { "field": "status", "operator": "=", "value": "active" }
@@ -0,0 +1,28 @@
1
+ # Developer Tools
2
+
3
+ ## OpenAPI Specification
4
+
5
+ - Auto-generated, tenant-specific OpenAPI specs reflecting all configured data sources and fields
6
+ - Regeneratable on-demand after schema changes
7
+ - Powers client SDK generation and API discovery
8
+
9
+ ## MCP Server (Model Context Protocol)
10
+
11
+ - Built-in MCP server exposing platform capabilities as AI-consumable tools
12
+ - Discovery, CRUD, querying, enum management, custom query execution, and JSONata evaluation — all accessible via MCP transport
13
+
14
+ ## CLI
15
+
16
+ - Full-featured CLI (`@docyrus/docyrus`) for terminal and AI agent use
17
+ - Commands: environment management, authentication, data operations, schema management (studio), app management, API discovery, AI chat, and direct API requests
18
+ - Multi-account, multi-tenant session management
19
+ - OpenAPI discovery with caching and fallback generation
20
+ - Interactive TUI mode
21
+
22
+ For full CLI command reference, see [docyrus-cli-usage.md](docyrus-cli-usage.md).
23
+
24
+ ## Client Libraries
25
+
26
+ - REST API client (`@docyrus/api-client`) with OAuth2 support, interceptors, streaming, and file operations
27
+ - React authentication provider (`@docyrus/signin`) with standalone OAuth2 PKCE and iframe postMessage modes
28
+ - Auto-generated collection hooks from OpenAPI specs for data fetching integration