@zeyos/client 0.2.0 → 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.
Files changed (118) hide show
  1. package/CHANGELOG.md +33 -4
  2. package/README.md +31 -1
  3. package/agents/README.md +4 -0
  4. package/agents/shared/zeyos-entity-map.md +5 -1
  5. package/agents/shared/zeyos-entity-reference.md +89 -33
  6. package/agents/zeyos-mail-operations/SKILL.md +7 -1
  7. package/agents/zeyos-mail-operations/references/workflows.md +19 -2
  8. package/agents/zeyos-platform-and-schema/SKILL.md +1 -1
  9. package/agents/zeyos-platform-and-schema/references/workflows.md +21 -5
  10. package/agents/zeyos-time-tracking/SKILL.md +48 -0
  11. package/agents/zeyos-time-tracking/references/workflows.md +230 -0
  12. package/agents/zeyos-work-management/SKILL.md +5 -2
  13. package/agents/zeyos-work-management/references/workflows.md +54 -4
  14. package/docs/02-javascript-client/03-making-requests.md +46 -1
  15. package/docs/03-cli/02-commands.md +63 -1
  16. package/docs/03-cli/03-configuration.md +37 -5
  17. package/docs/04-agent-workflows/01-agent-quickstart.md +24 -0
  18. package/docs/04-agent-workflows/03-cli-coverage-and-escalation.md +3 -2
  19. package/docs/06-okf/01-overview.md +70 -0
  20. package/docs/06-okf/02-producing-and-consuming.md +46 -0
  21. package/docs/06-okf/03-keeping-fresh.md +53 -0
  22. package/docs/06-okf/04-loops.md +58 -0
  23. package/docs/06-okf/_category_.json +9 -0
  24. package/okf/concepts/counting-and-sums.md +10 -0
  25. package/okf/concepts/dates-unix-seconds.md +12 -0
  26. package/okf/concepts/enums.md +14 -0
  27. package/okf/concepts/filters-vs-filter.md +14 -0
  28. package/okf/concepts/index.md +8 -0
  29. package/okf/concepts/operationid-vocabulary.md +17 -0
  30. package/okf/concepts/visibility-column.md +13 -0
  31. package/okf/entities/accounts.md +82 -0
  32. package/okf/entities/actionsteps.md +84 -0
  33. package/okf/entities/addresses.md +50 -0
  34. package/okf/entities/applicationassets.md +43 -0
  35. package/okf/entities/applications.md +62 -0
  36. package/okf/entities/appointments.md +79 -0
  37. package/okf/entities/associations.md +41 -0
  38. package/okf/entities/binfiles.md +32 -0
  39. package/okf/entities/campaigns.md +66 -0
  40. package/okf/entities/categories.md +55 -0
  41. package/okf/entities/channels.md +54 -0
  42. package/okf/entities/comments.md +44 -0
  43. package/okf/entities/components.md +46 -0
  44. package/okf/entities/contacts.md +96 -0
  45. package/okf/entities/contacts2contacts.md +42 -0
  46. package/okf/entities/contracts.md +83 -0
  47. package/okf/entities/couponcodes.md +58 -0
  48. package/okf/entities/coupons.md +69 -0
  49. package/okf/entities/customfields.md +59 -0
  50. package/okf/entities/davservers.md +74 -0
  51. package/okf/entities/devices.md +65 -0
  52. package/okf/entities/documents.md +76 -0
  53. package/okf/entities/dunning.md +82 -0
  54. package/okf/entities/dunning2transactions.md +46 -0
  55. package/okf/entities/entities2channels.md +42 -0
  56. package/okf/entities/events.md +57 -0
  57. package/okf/entities/feedservers.md +67 -0
  58. package/okf/entities/files.md +50 -0
  59. package/okf/entities/follows.md +40 -0
  60. package/okf/entities/forks.md +54 -0
  61. package/okf/entities/groups.md +48 -0
  62. package/okf/entities/groups2users.md +44 -0
  63. package/okf/entities/index.md +93 -0
  64. package/okf/entities/invitations.md +53 -0
  65. package/okf/entities/items.md +95 -0
  66. package/okf/entities/ledgers.md +56 -0
  67. package/okf/entities/likes.md +40 -0
  68. package/okf/entities/links.md +70 -0
  69. package/okf/entities/mailinglists.md +67 -0
  70. package/okf/entities/mailingrecipients.md +45 -0
  71. package/okf/entities/mailservers.md +77 -0
  72. package/okf/entities/messagereads.md +40 -0
  73. package/okf/entities/messages.md +104 -0
  74. package/okf/entities/notes.md +73 -0
  75. package/okf/entities/objects.md +70 -0
  76. package/okf/entities/opportunities.md +87 -0
  77. package/okf/entities/participants.md +52 -0
  78. package/okf/entities/payments.md +76 -0
  79. package/okf/entities/permissions.md +46 -0
  80. package/okf/entities/pricelists.md +70 -0
  81. package/okf/entities/pricelists2accounts.md +46 -0
  82. package/okf/entities/prices.md +49 -0
  83. package/okf/entities/projects.md +72 -0
  84. package/okf/entities/records.md +75 -0
  85. package/okf/entities/relateditems.md +43 -0
  86. package/okf/entities/resources.md +55 -0
  87. package/okf/entities/services.md +64 -0
  88. package/okf/entities/stocktransactions.md +72 -0
  89. package/okf/entities/storages.md +56 -0
  90. package/okf/entities/suppliers.md +51 -0
  91. package/okf/entities/tasks.md +86 -0
  92. package/okf/entities/tickets.md +86 -0
  93. package/okf/entities/transactions.md +118 -0
  94. package/okf/entities/users.md +66 -0
  95. package/okf/entities/weblets.md +66 -0
  96. package/okf/index.md +11 -0
  97. package/okf/log.md +4 -0
  98. package/okf/metrics/cash-received.md +10 -0
  99. package/okf/metrics/index.md +6 -0
  100. package/okf/metrics/invoiced-net-revenue.md +16 -0
  101. package/okf/metrics/open-customers.md +14 -0
  102. package/okf/metrics/overdue-receivables.md +12 -0
  103. package/okf/playbooks/customer-360.md +12 -0
  104. package/okf/playbooks/index.md +5 -0
  105. package/okf/playbooks/revenue-this-year.md +19 -0
  106. package/okf/playbooks/ticket-work-packet.md +11 -0
  107. package/package.json +9 -5
  108. package/scripts/data/okf-curation.mjs +258 -0
  109. package/scripts/generate-client.mjs +4 -275
  110. package/scripts/generate-okf.mjs +241 -0
  111. package/scripts/lib/okf.mjs +272 -0
  112. package/scripts/lib/spec-model.mjs +325 -0
  113. package/src/index.js +4 -0
  114. package/src/runtime/client.js +199 -18
  115. package/src/runtime/okf.js +237 -0
  116. package/samples/missioncontrol/README.md +0 -106
  117. package/samples/missioncontrol/fetch-data.mjs +0 -341
  118. package/samples/missioncontrol/index.html +0 -419
@@ -0,0 +1,70 @@
1
+ # OKF Overview
2
+
3
+ The **Open Knowledge Format (OKF v0.1)** is Google's minimal, vendor-neutral spec for
4
+ sharing the metadata and curated context that surrounds data: a directory of Markdown
5
+ files, each with YAML frontmatter whose only required field is `type`, optional `index.md`
6
+ and `log.md`, and Markdown cross-links that turn the directory into a knowledge graph.
7
+ Producers emit a bundle; consumers (coding agents, viewers, search) read it.
8
+
9
+ `@zeyos/client` ships a conformant OKF bundle under [`okf/`](https://github.com/zeyos/client/tree/main/okf)
10
+ that describes the ZeyOS data model, and tooling to produce, consume, validate, and refine it.
11
+
12
+ ## Why OKF fits ZeyOS
13
+
14
+ The client already derives a compact schema from the OpenAPI/dbref specs. OKF turns that —
15
+ plus the curated business knowledge that used to live only in the skill pack — into a
16
+ portable knowledge layer any agent or tool can read, independent of this client.
17
+
18
+ The bundle is **canonical** for ZeyOS structural facts: the hand-maintained
19
+ `agents/shared/zeyos-entity-reference.md` operationId table is now generated from the same
20
+ source, so the skills and the OKF bundle can't drift apart.
21
+
22
+ ## Bundle layout
23
+
24
+ ```
25
+ okf/
26
+ index.md # root listing; frontmatter: okf_version, source_snapshot
27
+ log.md # schema-change history (auto-appended on real changes)
28
+ entities/ # one concept per API-backed entity — type: ZeyOS Entity
29
+ index.md
30
+ accounts.md tickets.md transactions.md …
31
+ metrics/ # business metric definitions — type: Metric
32
+ playbooks/ # step-by-step query workflows — type: Playbook
33
+ concepts/ # cross-cutting rules / footguns — type: Reference
34
+ ```
35
+
36
+ Each entity concept carries a **Schema** table (column, type, nullability, default, index,
37
+ foreign key), **Foreign Keys** (cross-linked to the target entity), **Enums** (parsed from
38
+ the schema), **Indexes** (including the GIN/partial indexes behind the `filters` footgun),
39
+ and **Operations** (the real `@zeyos/client` operationIds, read straight from `api.json`).
40
+
41
+ ## Generated vs curated: managed blocks
42
+
43
+ Each entity concept mixes auto-generated structure with curated prose. The generated region
44
+ is fenced by HTML-comment markers:
45
+
46
+ ```markdown
47
+ <!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
48
+ # Schema
49
+
50
+ <!-- okf:generated:end -->
51
+
52
+ # Notes
53
+ Curated guidance — preserved across every regeneration.
54
+ ```
55
+
56
+ The producer rewrites **only** the region between the markers. Curated `# Notes`/`# Metrics`
57
+ prose (added by a human or the refinement loop) is preserved verbatim, so regenerating after
58
+ a schema change never clobbers curation. See [Keeping OKF fresh](./03-keeping-fresh.md).
59
+
60
+ ## Relationship to the skill pack
61
+
62
+ Two projections of one knowledge core:
63
+
64
+ - **Skills** (`agents/`) stay the task/runner-facing layer: the operating contract, "act,
65
+ don't plan", and safety.
66
+ - **OKF** (`okf/`) is the reference layer: the entity schema-of-record plus the metric,
67
+ playbook, and concept catalog.
68
+
69
+ Skills point into `okf/`; when a schema fact in a shared reference and in `okf/` ever
70
+ disagree, `okf/` wins.
@@ -0,0 +1,46 @@
1
+ # Producing & Consuming OKF
2
+
3
+ ## CLI
4
+
5
+ ```bash
6
+ zeyos okf list # list concepts (type, id, title); --json for automation
7
+ zeyos okf show tickets # print a concept (bare resource name or entities/tickets)
8
+ zeyos okf check # validate the bundle for OKF v0.1 conformance (exit non-zero on error)
9
+ zeyos okf export --out ./okf # copy the shipped bundle into a directory
10
+ zeyos okf build --out ./okf # synthesize a bundle from the client's schema
11
+ ```
12
+
13
+ `export` copies the rich shipped bundle (with curated metrics/playbooks/notes). `build`
14
+ synthesizes a structural bundle from the client's introspection surface — useful where the
15
+ shipped files aren't present, or to diff against a live instance.
16
+
17
+ ## JavaScript client
18
+
19
+ The OKF surface is exported from `@zeyos/client`:
20
+
21
+ ```js
22
+ import { buildOkf, loadOkfBundle, validateOkfBundle, validateOkfFiles, OKF_VERSION } from '@zeyos/client';
23
+
24
+ // Synthesize a conformant bundle from the client's generated schema (pure; browser-safe).
25
+ const files = buildOkf(); // { 'entities/tickets.md': '…', … }
26
+ const { valid, errors } = validateOkfFiles(files);
27
+
28
+ // Load the shipped (or any) bundle from disk (Node only).
29
+ const bundle = await loadOkfBundle('node_modules/@zeyos/client/okf');
30
+ bundle.version; // '0.1'
31
+ bundle.concepts['entities/tickets'].frontmatter // { type: 'ZeyOS Entity', title: 'Tickets', … }
32
+
33
+ // Validate a directory or an in-memory file map.
34
+ await validateOkfBundle('okf');
35
+ ```
36
+
37
+ - `buildOkf({ schema?, services? })` — pure producer; defaults to the generated `SCHEMA`/`SERVICES`.
38
+ - `loadOkfBundle(dir)` — Node-only reader (lazy `fs`), returns `{ version, files, concepts }`.
39
+ - `validateOkfBundle(dirOrFiles)` / `validateOkfFiles(files)` — v0.1 conformance check.
40
+
41
+ ## Build-time producer
42
+
43
+ In this repo, `npm run okf:build` (or `npm run generate`, which runs it alongside the client
44
+ codegen) emits the rich bundle from `openapi/{api,dbref}.json` plus the curated content in
45
+ `scripts/data/okf-curation.mjs`. It also injects the generated operationId table into
46
+ `agents/shared/zeyos-entity-reference.md`. Validate with `npm run okf:check`.
@@ -0,0 +1,53 @@
1
+ # Keeping OKF Fresh
2
+
3
+ The OKF bundle is generated from the OpenAPI/dbref snapshots in `openapi/`. When ZeyOS
4
+ updates its database model or API, those specs are re-exported and the bundle is
5
+ regenerated. The design keeps that safe and observable.
6
+
7
+ ## What protects curation
8
+
9
+ 1. **Deterministic generation.** `npm run generate` runs the OKF producer alongside the
10
+ client codegen. Re-running with unchanged specs produces **no diff** (no timestamp churn).
11
+ 2. **Managed blocks.** Only the fenced `okf:generated` region of each entity concept is
12
+ rewritten; curated `# Notes`/`# Metrics` prose is spliced back unchanged. See the
13
+ [overview](./01-overview.md#generated-vs-curated-managed-blocks).
14
+ 3. **`source_snapshot`.** The root `index.md` frontmatter carries a content hash of the
15
+ schema. When the specs change, the hash changes — a staleness signal for consumers and
16
+ the drift gate.
17
+ 4. **`log.md` schema diff.** The producer diffs the new schema against the last snapshot and
18
+ appends a dated entry (added/removed fields, changed enums, new foreign keys) — an
19
+ OKF-native, human- and agent-readable record of *what changed when the model updated*.
20
+
21
+ ## The spec-refresh runbook
22
+
23
+ ```bash
24
+ # 1. Replace the snapshots with the newly exported specs
25
+ # openapi/api.json, openapi/dbref.json
26
+
27
+ # 2. Regenerate the client and the OKF bundle
28
+ npm run generate
29
+
30
+ # 3. Review the diff and the changelog
31
+ git diff okf/ agents/shared/zeyos-entity-reference.md
32
+ cat okf/log.md # newest dated entry summarizes the schema changes
33
+
34
+ # 4. Validate conformance + the drift gate
35
+ npm run okf:check
36
+
37
+ # 5. (Optional) enrich weak concepts — see ./04-loops.md
38
+ npm run okf:refine -- --concept entities/<changed-entity>
39
+
40
+ # 6. Commit
41
+ git add okf agents/shared src/generated && git commit -m "Refresh schema + OKF"
42
+ ```
43
+
44
+ ## The drift gate (CI)
45
+
46
+ `npm run okf:check` runs `test/okf.test.js`, which regenerates the bundle and asserts the
47
+ committed content matches a fresh regen. It fails the build when:
48
+
49
+ - the specs changed but `okf/` wasn't regenerated and committed;
50
+ - someone hand-edited a generated region;
51
+ - a concept is non-conformant, an API-backed entity lacks a concept, or a structural
52
+ cross-link is broken;
53
+ - the shared reference's generated operationId table fell out of sync.
@@ -0,0 +1,58 @@
1
+ # Refining with Loops
2
+
3
+ OKF and the skill pack are refined with the same loop machinery the agent protocol already
4
+ uses — a measurement loop and a refinement loop that close on each other.
5
+
6
+ ## Measure: OKF as agent context
7
+
8
+ The agent protocol (`npm run test:agent-protocol`) drives a real coding agent through
9
+ business scenarios against a live demo instance and verifies each outcome independently. A
10
+ `--context` axis chooses which knowledge the agent is pointed at:
11
+
12
+ ```bash
13
+ # Skills only (default), OKF only, or both
14
+ npm run test:agent-protocol -- --context okf --scenario b03-billing-transaction-count
15
+ npm run test:agent-protocol -- --context both --layer b
16
+ ```
17
+
18
+ The bundle is exposed to the agent as `ZEYOS_OKF_ROOT` (mirroring `ZEYOS_SKILL_ROOT`). The
19
+ loop runner sweeps the axis and reports per-context pass rates, so you can see whether
20
+ OKF-as-context lifts accuracy and which concepts correlate with failures:
21
+
22
+ ```bash
23
+ npm run test:agent-loop -- --context skills,okf,both --read-only --agents opencode
24
+ ```
25
+
26
+ The scorecard tells you which **skill** and which **OKF concept** to improve.
27
+
28
+ ## Refine: generate → validate → judge → apply
29
+
30
+ `npm run okf:refine` improves a concept's **curated** guidance (never the generated block):
31
+
32
+ ```bash
33
+ # Target a concept directly, or derive weak concepts from a run's scorecard
34
+ npm run okf:refine -- --concept entities/tickets
35
+ npm run okf:refine -- --scorecard test/agent-protocol/results/<run>/scorecard.json
36
+ npm run okf:refine -- --concept entities/transactions --apply # write the accepted revision
37
+ ```
38
+
39
+ Each target goes through:
40
+
41
+ 1. **Generate** — a proposer model drafts improved curated notes from the current concept.
42
+ 2. **Validate** — any field the proposal references must exist on the entity (checked
43
+ against the client schema), so the model can't invent columns or enums.
44
+ 3. **Judge** — a held-out judge model (`agentProtocol.judgeModel`, reusing `judge.mjs`)
45
+ approves only if the revision is more accurate and useful and contradicts no schema fact.
46
+ 4. **Apply** — with `--apply`, the accepted notes replace the curated tail; the generated
47
+ managed block is never touched. Without `--apply`, proposals are written for review.
48
+
49
+ ## The closed loop
50
+
51
+ ```
52
+ specs + curation ──▶ okf/ ──▶ agent-protocol (--context okf) ──▶ scorecard
53
+ ▲ │
54
+ └──────────── okf:refine (curated notes) ◀─────────────────┘
55
+ ```
56
+
57
+ Drive it self-paced with the Claude Code `/loop` skill: *measure → pick the weakest concept
58
+ → refine → re-measure*, until pass rates plateau.
@@ -0,0 +1,9 @@
1
+ {
2
+ "label": "Open Knowledge Format (OKF)",
3
+ "position": 7,
4
+ "collapsed": false,
5
+ "link": {
6
+ "type": "generated-index",
7
+ "description": "The ZeyOS knowledge bundle in Google's Open Knowledge Format — a portable, Git-native Markdown description of the data model that agents and tools consume, how to produce and keep it fresh, and how it ties into the skill-improvement loops."
8
+ }
9
+ }
@@ -0,0 +1,10 @@
1
+ ---
2
+ type: Reference
3
+ title: Counting and summing
4
+ description: "Count server-side; there is no server-side SUM."
5
+ tags: [query]
6
+ ---
7
+
8
+ **Counts.** Use `zeyos count <resource>` (CLI) or `count: true` on the list call (client). Never `list` + array length: `zeyos list` defaults to `--limit 50`, so you get the page size, not the total (the only `--json` truncation signal is a stderr "Showing X–Y of TOTAL" hint).
9
+
10
+ **Sums.** There is no server-side SUM. `list` the matching rows with the numeric field at a high `--limit` (up to 10000) and add them up client-side.
@@ -0,0 +1,12 @@
1
+ ---
2
+ type: Reference
3
+ title: Dates are Unix seconds
4
+ description: "All ZeyOS timestamps are Unix seconds; pick the indexed date field."
5
+ tags: [query]
6
+ ---
7
+
8
+ All ZeyOS dates are Unix timestamps in **seconds** (not milliseconds).
9
+
10
+ - `date` — business-effective date (invoice date, message date). Use for period reporting. Indexed.
11
+ - `lastmodified` — recent-change tracking.
12
+ - `creationdate` — often **unindexed**; filtering a time window on it (or other unindexed date columns) can return **HTTP 503**. Prefer the indexed `date` field for windows.
@@ -0,0 +1,14 @@
1
+ ---
2
+ type: Reference
3
+ title: Common enums
4
+ description: "Priority and ticket status enum values."
5
+ tags: [reference]
6
+ ---
7
+
8
+ Each entity concept's **Enums** section carries that entity's enums (parsed from the schema). The most-used:
9
+
10
+ **Priority** (tickets/tasks): `0`=LOWEST, `1`=LOW, `2`=MEDIUM, `3`=HIGH, `4`=HIGHEST.
11
+
12
+ **Ticket status**: `0`=NOT_STARTED, `1`=AWAITING_ACCEPTANCE, `2`=ACCEPTED, `3`=REJECTED, `4`=ACTIVE, `5`=INACTIVE, `6`=FEEDBACK_REQUIRED, `7`=TESTING, `8`=CANCELLED, `9`=COMPLETED, `10`=FAILED, `11`=BOOKED. Closed = IN [9, 11].
13
+
14
+ **Account type**: `0`=PROSPECT, `1`=CUSTOMER, `2`=SUPPLIER, `3`=CUSTOMERANDSUPPLIER, `4`=COMPETITOR, `5`=EMPLOYEE.
@@ -0,0 +1,14 @@
1
+ ---
2
+ type: Reference
3
+ title: filters vs filter (the FK/GIN footgun)
4
+ description: "Use `filters` (plural) so foreign-key fields match via their GIN/partial indexes."
5
+ tags: [query]
6
+ ---
7
+
8
+ The OpenAPI spec documents the list body field as `filter` (singular), but **`filters` (plural)** is what reliably matches GIN-indexed / partial-indexed foreign-key fields (`account`, `project`, `ticket` on related resources).
9
+
10
+ - `@zeyos/client`: use `filters`.
11
+ - `zeyos` CLI: pass `--filter '{…}'` — it serializes to `filters` internally.
12
+ - Raw REST: the spec says `filter`; verify against the target instance.
13
+
14
+ `client.schema.validate()` flags a top-level `filter` on list/count ops and suggests `filters`. Only filter on columns the resource actually has — an unknown column 400s with no hint which field was wrong (run `zeyos describe <resource>` first).
@@ -0,0 +1,8 @@
1
+ # Concepts
2
+
3
+ * [Common enums](enums.md) - Priority and ticket status enum values.
4
+ * [Counting and summing](counting-and-sums.md) - Count server-side; there is no server-side SUM.
5
+ * [Dates are Unix seconds](dates-unix-seconds.md) - All ZeyOS timestamps are Unix seconds; pick the indexed date field.
6
+ * [filters vs filter (the FK/GIN footgun)](filters-vs-filter.md) - Use `filters` (plural) so foreign-key fields match via their GIN/partial indexes.
7
+ * [operationId ≠ table noun](operationid-vocabulary.md) - REST operationIds are CamelCase compounds; several diverge from the dbref noun.
8
+ * [visibility: 0 (only where the column exists)](visibility-column.md) - visibility:0 hides archived rows — but only resources that have the column.
@@ -0,0 +1,17 @@
1
+ ---
2
+ type: Reference
3
+ title: operationId ≠ table noun
4
+ description: "REST operationIds are CamelCase compounds; several diverge from the dbref noun."
5
+ tags: [query]
6
+ ---
7
+
8
+ The dbref table noun (also the REST URL path segment) is **not** the `@zeyos/client` operationId. Most follow `list<Plural>`/`get<Singular>`/… but several diverge:
9
+
10
+ - `dunning` → `listDunningNotices` / `getDunningNotice`
11
+ - `dunning2transactions` → `listDunningToTransactions`
12
+ - `pricelists` → `listPriceLists`; `pricelists2accounts` → `listPriceListsToAccounts`
13
+ - `mailinglists` → `listMailingLists`; `actionsteps` → `listActionSteps`
14
+ - `categories` → `listCategorys` (sic) but `getCategory`
15
+ - `davservers` → `listDAVServers`; `binfiles` → `listBinFiles` (list-only)
16
+
17
+ Each entity concept's **Operations** section lists its real operationIds (read straight from `api.json`). `client.schema.validate()` suggests the closest operationId for an unknown name.
@@ -0,0 +1,13 @@
1
+ ---
2
+ type: Reference
3
+ title: visibility: 0 (only where the column exists)
4
+ description: "visibility:0 hides archived rows — but only resources that have the column."
5
+ tags: [query]
6
+ ---
7
+
8
+ `visibility = 0` excludes archived/deleted rows, but **only some resources have a `visibility` column**:
9
+
10
+ - Have it: [tickets](/entities/tickets.md), [accounts](/entities/accounts.md), [items](/entities/items.md).
11
+ - Do **not** have it: [transactions](/entities/transactions.md) — adding `"visibility":0` there returns an opaque **HTTP 400**.
12
+
13
+ More generally, filtering on any column a resource lacks 400s with no field name. Include `visibility:0` on resources that have it unless the user wants archived records; `zeyos describe <resource>` tells you whether the column exists.
@@ -0,0 +1,82 @@
1
+ ---
2
+ type: ZeyOS Entity
3
+ title: Accounts
4
+ description: Customer, supplier, prospect, or employee master records.
5
+ resource: zeyos://api/accounts
6
+ tags: [crm, generated]
7
+ api_backed: true
8
+ list_operation: listAccounts
9
+ visibility_column: true
10
+ ---
11
+
12
+ <!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
13
+ # Schema
14
+
15
+ | Column | Type | Nullable | Default | Indexed | FK |
16
+ |---|---|---|---|---|---|
17
+ | `ID` | integer | no | — | yes | — |
18
+ | `fork` | integer | yes | — | yes | [forks](/entities/forks.md) |
19
+ | `ownergroup` | integer | yes | — | yes | [groups](/entities/groups.md) |
20
+ | `creator` | integer | yes | — | — | — |
21
+ | `assigneduser` | integer | yes | — | yes | [users](/entities/users.md) |
22
+ | `creationdate` | bigint | no | `date_part('epoch', now())` | — | — |
23
+ | `lastmodified` | bigint | no | `date_part('epoch', now())` | — | — |
24
+ | `contact` | integer | yes | — | yes | [contacts](/entities/contacts.md) |
25
+ | `visibility` | smallint | no | `0` | — | — |
26
+ | `lastname` | text | no | `''` | yes | — |
27
+ | `firstname` | text | no | `''` | yes | — |
28
+ | `type` | smallint | no | `0` | — | — |
29
+ | `customernum` | text | no | `''` | yes | — |
30
+ | `suppliernum` | text | no | `''` | yes | — |
31
+ | `taxid` | text | no | `''` | — | — |
32
+ | `currency` | character varying(3) | no | — | — | — |
33
+ | `locked` | smallint | no | `0` | — | — |
34
+ | `excludetax` | smallint | no | `0` | — | — |
35
+ | `description` | text | no | `''` | — | — |
36
+
37
+ # Foreign Keys
38
+
39
+ - `fork` → [forks](/entities/forks.md) (`forks.ID`)
40
+ - `ownergroup` → [groups](/entities/groups.md) (`groups.ID`)
41
+ - `assigneduser` → [users](/entities/users.md) (`users.ID`)
42
+ - `contact` → [contacts](/entities/contacts.md) (`contacts.ID`)
43
+
44
+ # Enums
45
+
46
+ ### `visibility`
47
+
48
+ `0` = REGULAR · `1` = ARCHIVED · `2` = DELETED
49
+
50
+ ### `type`
51
+
52
+ `0` = PROSPECT · `1` = CUSTOMER · `2` = SUPPLIER · `3` = CUSTOMERANDSUPPLIER · `4` = COMPETITOR · `5` = EMPLOYEE
53
+
54
+ # Indexes
55
+
56
+ - `fk_accounts_assigneduser` — gin, partial on `assigneduser`
57
+ - `fk_accounts_contact` — btree, partial on `contact`
58
+ - `fk_accounts_fork` — gin, partial on `fork`
59
+ - `fk_accounts_ownergroup` — gin on `ownergroup`
60
+ - `i_accounts_lastname_firstname` — btree on `lastname, firstname`
61
+ - `i_accounts_nofork` — gin, partial on `fork`
62
+ - `i_accounts_noowner` — gin, partial on `ownergroup`
63
+ - `s_accounts_customernum` — gin, partial on `customernum`
64
+ - `s_accounts_firstname` — gin, partial on `firstname`
65
+ - `s_accounts_lastname` — gin, partial on `lastname`
66
+ - `s_accounts_suppliernum` — gin, partial on `suppliernum`
67
+
68
+ > Partial/GIN indexes back the `filters` (plural) query form for foreign-key fields. See [filters-vs-filter](/concepts/filters-vs-filter.md).
69
+
70
+ # Operations
71
+
72
+ - list: `listAccounts`
73
+ - get: `getAccount`
74
+ - create: `createAccount`
75
+ - update: `updateAccount`
76
+ - delete: `deleteAccount`
77
+ - exists: `existsAccount`
78
+ <!-- okf:generated:end -->
79
+
80
+ # Notes
81
+
82
+ No `name` column — use `lastname` + `firstname`. `type`: 0=PROSPECT,1=CUSTOMER,2=SUPPLIER,3=CUSTOMERANDSUPPLIER,4=COMPETITOR,5=EMPLOYEE. `createAccount` REQUIRES `currency` (NOT NULL, no default) or it 500s.
@@ -0,0 +1,84 @@
1
+ ---
2
+ type: ZeyOS Entity
3
+ title: Action Steps
4
+ description: Cross-record follow-up work items with assignee, due date, status, and effort.
5
+ resource: zeyos://api/actionsteps
6
+ tags: [work, generated]
7
+ api_backed: true
8
+ list_operation: listActionSteps
9
+ visibility_column: false
10
+ ---
11
+
12
+ <!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
13
+ # Schema
14
+
15
+ | Column | Type | Nullable | Default | Indexed | FK |
16
+ |---|---|---|---|---|---|
17
+ | `ID` | integer | no | — | yes | — |
18
+ | `fork` | integer | yes | — | yes | [forks](/entities/forks.md) |
19
+ | `owneruser` | integer | yes | — | yes | [users](/entities/users.md) |
20
+ | `ownergroup` | integer | yes | — | yes | [groups](/entities/groups.md) |
21
+ | `creator` | integer | yes | — | — | — |
22
+ | `assigneduser` | integer | yes | — | yes | [users](/entities/users.md) |
23
+ | `creationdate` | bigint | no | `date_part('epoch', now())` | — | — |
24
+ | `lastmodified` | bigint | no | `date_part('epoch', now())` | — | — |
25
+ | `task` | integer | yes | — | yes | [tasks](/entities/tasks.md) |
26
+ | `ticket` | integer | yes | — | yes | [tickets](/entities/tickets.md) |
27
+ | `account` | integer | yes | — | yes | [accounts](/entities/accounts.md) |
28
+ | `transaction` | integer | yes | — | yes | [transactions](/entities/transactions.md) |
29
+ | `name` | text | no | — | yes | — |
30
+ | `actionnum` | text | no | `''` | yes | — |
31
+ | `date` | bigint | no | `date_part('epoch', now())` | yes | — |
32
+ | `duedate` | bigint | yes | — | — | — |
33
+ | `status` | smallint | no | `0` | — | — |
34
+ | `effort` | integer | no | `0` | — | — |
35
+ | `description` | text | no | `''` | — | — |
36
+
37
+ # Foreign Keys
38
+
39
+ - `fork` → [forks](/entities/forks.md) (`forks.ID`)
40
+ - `owneruser` → [users](/entities/users.md) (`users.ID`)
41
+ - `ownergroup` → [groups](/entities/groups.md) (`groups.ID`)
42
+ - `assigneduser` → [users](/entities/users.md) (`users.ID`)
43
+ - `task` → [tasks](/entities/tasks.md) (`tasks.ID`)
44
+ - `ticket` → [tickets](/entities/tickets.md) (`tickets.ID`)
45
+ - `account` → [accounts](/entities/accounts.md) (`accounts.ID`)
46
+ - `transaction` → [transactions](/entities/transactions.md) (`transactions.ID`)
47
+
48
+ # Enums
49
+
50
+ ### `status`
51
+
52
+ `0` = DRAFT · `1` = COMPLETED · `2` = CANCELLED · `3` = BOOKED
53
+
54
+ # Indexes
55
+
56
+ - `fk_actionsteps_account` — btree, partial on `account`
57
+ - `fk_actionsteps_assigneduser` — gin, partial on `assigneduser`
58
+ - `fk_actionsteps_fork` — gin, partial on `fork`
59
+ - `fk_actionsteps_ownergroup` — gin, partial on `ownergroup`
60
+ - `fk_actionsteps_owneruser` — gin, partial on `owneruser`
61
+ - `fk_actionsteps_task` — btree, partial on `task`
62
+ - `fk_actionsteps_ticket` — btree, partial on `ticket`
63
+ - `fk_actionsteps_transaction` — btree, partial on `transaction`
64
+ - `i_actionsteps_date` — btree on `date`
65
+ - `i_actionsteps_nofork` — gin, partial on `fork`
66
+ - `i_actionsteps_noowner` — gin, partial on `ownergroup`
67
+ - `s_actionsteps_actionnum` — gin, partial on `actionnum`
68
+ - `s_actionsteps_name` — gin on `name`
69
+
70
+ > Partial/GIN indexes back the `filters` (plural) query form for foreign-key fields. See [filters-vs-filter](/concepts/filters-vs-filter.md).
71
+
72
+ # Operations
73
+
74
+ - list: `listActionSteps`
75
+ - get: `getActionStep`
76
+ - create: `createActionStep`
77
+ - update: `updateActionStep`
78
+ - delete: `deleteActionStep`
79
+ - exists: `existsActionStep`
80
+ <!-- okf:generated:end -->
81
+
82
+ # Notes
83
+
84
+ Record-bound follow-ups (linked to a task, ticket, or account, with optional transaction). Do not inflate into full project tasks.
@@ -0,0 +1,50 @@
1
+ ---
2
+ type: ZeyOS Entity
3
+ title: Addresses
4
+ description: Additional address records linked to accounts or contacts.
5
+ resource: zeyos://api/addresses
6
+ tags: [crm, generated]
7
+ api_backed: true
8
+ list_operation: listAddresses
9
+ visibility_column: false
10
+ ---
11
+
12
+ <!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
13
+ # Schema
14
+
15
+ | Column | Type | Nullable | Default | Indexed | FK |
16
+ |---|---|---|---|---|---|
17
+ | `ID` | bigint | no | — | yes | — |
18
+ | `creator` | integer | yes | — | — | — |
19
+ | `creationdate` | bigint | no | `date_part('epoch', now())` | — | — |
20
+ | `lastmodified` | bigint | no | `date_part('epoch', now())` | — | — |
21
+ | `account` | integer | no | — | yes | [accounts](/entities/accounts.md) |
22
+ | `contact` | integer | no | — | yes | [contacts](/entities/contacts.md) |
23
+ | `type` | smallint | no | `0` | yes | — |
24
+ | `default` | smallint | no | `0` | yes | — |
25
+
26
+ # Foreign Keys
27
+
28
+ - `account` → [accounts](/entities/accounts.md) (`accounts.ID`)
29
+ - `contact` → [contacts](/entities/contacts.md) (`contacts.ID`)
30
+
31
+ # Enums
32
+
33
+ ### `type`
34
+
35
+ `0` = BILLING_SHIPPING · `1` = BILLING_BILLING · `2` = PROCUREMENT_SHIPPING · `3` = PROCUREMENT_BILLING · `4` = COLLECTION · `5` = BILLING_SELLER · `6` = PROCUREMENT_SELLER
36
+
37
+ # Indexes
38
+
39
+ - `fk_addresses_contact` — btree on `contact`
40
+ - `u_addresses_account_contact_type` — btree, unique on `account, contact, type, +default`
41
+
42
+ # Operations
43
+
44
+ - list: `listAddresses`
45
+ - get: `getAddress`
46
+ - create: `createAddress`
47
+ - update: `updateAddress`
48
+ - delete: `deleteAddress`
49
+ - exists: `existsAddress`
50
+ <!-- okf:generated:end -->
@@ -0,0 +1,43 @@
1
+ ---
2
+ type: ZeyOS Entity
3
+ title: Application Assets
4
+ description: Assets linked to an application.
5
+ resource: zeyos://api/applicationassets
6
+ tags: [platform, generated]
7
+ api_backed: true
8
+ list_operation: listApplicationAssets
9
+ visibility_column: false
10
+ ---
11
+
12
+ <!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
13
+ # Schema
14
+
15
+ | Column | Type | Nullable | Default | Indexed | FK |
16
+ |---|---|---|---|---|---|
17
+ | `ID` | bigint | no | — | yes | — |
18
+ | `creator` | integer | yes | — | — | — |
19
+ | `creationdate` | bigint | no | `EXTRACT(epoch FROM now())` | — | — |
20
+ | `lastmodified` | bigint | no | `EXTRACT(epoch FROM now())` | — | — |
21
+ | `application` | integer | no | — | yes | [applications](/entities/applications.md) |
22
+ | `binfile` | integer | yes | — | yes | [binfiles](/entities/binfiles.md) |
23
+ | `filename` | text | no | — | yes | — |
24
+ | `mimetype` | text | no | `'application/octet-stream'` | — | — |
25
+
26
+ # Foreign Keys
27
+
28
+ - `application` → [applications](/entities/applications.md) (`applications.ID`)
29
+ - `binfile` → [binfiles](/entities/binfiles.md) (`binfiles.ID`)
30
+
31
+ # Indexes
32
+
33
+ - `fk_applicationassets_binfile` — btree, partial on `binfile`
34
+ - `u_applicationassets_application_filename` — btree, unique on `application, filename`
35
+
36
+ > Partial/GIN indexes back the `filters` (plural) query form for foreign-key fields. See [filters-vs-filter](/concepts/filters-vs-filter.md).
37
+
38
+ # Operations
39
+
40
+ - list: `listApplicationAssets`
41
+ - get: `getApplicationAsset`
42
+ - exists: `existsApplicationAsset`
43
+ <!-- okf:generated:end -->
@@ -0,0 +1,62 @@
1
+ ---
2
+ type: ZeyOS Entity
3
+ title: Applications
4
+ description: Application definitions.
5
+ resource: zeyos://api/applications
6
+ tags: [platform, generated]
7
+ api_backed: true
8
+ list_operation: listApplications
9
+ visibility_column: false
10
+ ---
11
+
12
+ <!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
13
+ # Schema
14
+
15
+ | Column | Type | Nullable | Default | Indexed | FK |
16
+ |---|---|---|---|---|---|
17
+ | `ID` | integer | no | — | yes | — |
18
+ | `creator` | integer | yes | — | — | — |
19
+ | `creationdate` | bigint | no | `date_part('epoch', now())` | — | — |
20
+ | `lastmodified` | bigint | no | `date_part('epoch', now())` | — | — |
21
+ | `activity` | smallint | no | `0` | — | — |
22
+ | `readmebinfile` | integer | yes | — | — | [binfiles](/entities/binfiles.md) |
23
+ | `name` | text | no | — | yes | — |
24
+ | `identifier` | character varying(200) | no | — | yes | — |
25
+ | `vendor` | text | no | `''` | — | — |
26
+ | `restricted` | smallint | no | `0` | — | — |
27
+ | `callbackurls` | text[] | yes | — | — | — |
28
+ | `settingscodebinfile` | integer | yes | — | yes | [binfiles](/entities/binfiles.md) |
29
+ | `usersettingscodebinfile` | integer | yes | — | yes | [binfiles](/entities/binfiles.md) |
30
+ | `secret` | bytea | yes | — | yes | — |
31
+ | `defaultsettings` | json | yes | — | — | — |
32
+ | `settings` | json | yes | — | — | — |
33
+
34
+ # Foreign Keys
35
+
36
+ - `readmebinfile` → [binfiles](/entities/binfiles.md) (`binfiles.ID`)
37
+ - `settingscodebinfile` → [binfiles](/entities/binfiles.md) (`binfiles.ID`)
38
+ - `usersettingscodebinfile` → [binfiles](/entities/binfiles.md) (`binfiles.ID`)
39
+
40
+ # Enums
41
+
42
+ ### `activity`
43
+
44
+ `0` = ACTIVE · `1` = DEACTIVATED · `2` = DELETED
45
+
46
+ # Indexes
47
+
48
+ - `fk_applications_settingscodebinfile` — btree, partial on `settingscodebinfile`
49
+ - `fk_applications_usersettingscodebinfile` — btree, partial on `usersettingscodebinfile`
50
+ - `s_applications_identifier` — gin on `identifier`
51
+ - `s_applications_name` — gin on `name`
52
+ - `u_applications_identifier` — btree, unique on `identifier`
53
+ - `u_applications_secret` — btree, unique, partial on `secret`
54
+
55
+ > Partial/GIN indexes back the `filters` (plural) query form for foreign-key fields. See [filters-vs-filter](/concepts/filters-vs-filter.md).
56
+
57
+ # Operations
58
+
59
+ - list: `listApplications`
60
+ - get: `getApplication`
61
+ - exists: `existsApplication`
62
+ <!-- okf:generated:end -->