@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.
- package/CHANGELOG.md +33 -4
- package/README.md +31 -1
- package/agents/README.md +4 -0
- package/agents/shared/zeyos-entity-map.md +5 -1
- package/agents/shared/zeyos-entity-reference.md +89 -33
- package/agents/zeyos-mail-operations/SKILL.md +7 -1
- package/agents/zeyos-mail-operations/references/workflows.md +19 -2
- package/agents/zeyos-platform-and-schema/SKILL.md +1 -1
- package/agents/zeyos-platform-and-schema/references/workflows.md +21 -5
- package/agents/zeyos-time-tracking/SKILL.md +48 -0
- package/agents/zeyos-time-tracking/references/workflows.md +230 -0
- package/agents/zeyos-work-management/SKILL.md +5 -2
- package/agents/zeyos-work-management/references/workflows.md +54 -4
- package/docs/02-javascript-client/03-making-requests.md +46 -1
- package/docs/03-cli/02-commands.md +63 -1
- package/docs/03-cli/03-configuration.md +37 -5
- package/docs/04-agent-workflows/01-agent-quickstart.md +24 -0
- package/docs/04-agent-workflows/03-cli-coverage-and-escalation.md +3 -2
- package/docs/06-okf/01-overview.md +70 -0
- package/docs/06-okf/02-producing-and-consuming.md +46 -0
- package/docs/06-okf/03-keeping-fresh.md +53 -0
- package/docs/06-okf/04-loops.md +58 -0
- package/docs/06-okf/_category_.json +9 -0
- package/okf/concepts/counting-and-sums.md +10 -0
- package/okf/concepts/dates-unix-seconds.md +12 -0
- package/okf/concepts/enums.md +14 -0
- package/okf/concepts/filters-vs-filter.md +14 -0
- package/okf/concepts/index.md +8 -0
- package/okf/concepts/operationid-vocabulary.md +17 -0
- package/okf/concepts/visibility-column.md +13 -0
- package/okf/entities/accounts.md +82 -0
- package/okf/entities/actionsteps.md +84 -0
- package/okf/entities/addresses.md +50 -0
- package/okf/entities/applicationassets.md +43 -0
- package/okf/entities/applications.md +62 -0
- package/okf/entities/appointments.md +79 -0
- package/okf/entities/associations.md +41 -0
- package/okf/entities/binfiles.md +32 -0
- package/okf/entities/campaigns.md +66 -0
- package/okf/entities/categories.md +55 -0
- package/okf/entities/channels.md +54 -0
- package/okf/entities/comments.md +44 -0
- package/okf/entities/components.md +46 -0
- package/okf/entities/contacts.md +96 -0
- package/okf/entities/contacts2contacts.md +42 -0
- package/okf/entities/contracts.md +83 -0
- package/okf/entities/couponcodes.md +58 -0
- package/okf/entities/coupons.md +69 -0
- package/okf/entities/customfields.md +59 -0
- package/okf/entities/davservers.md +74 -0
- package/okf/entities/devices.md +65 -0
- package/okf/entities/documents.md +76 -0
- package/okf/entities/dunning.md +82 -0
- package/okf/entities/dunning2transactions.md +46 -0
- package/okf/entities/entities2channels.md +42 -0
- package/okf/entities/events.md +57 -0
- package/okf/entities/feedservers.md +67 -0
- package/okf/entities/files.md +50 -0
- package/okf/entities/follows.md +40 -0
- package/okf/entities/forks.md +54 -0
- package/okf/entities/groups.md +48 -0
- package/okf/entities/groups2users.md +44 -0
- package/okf/entities/index.md +93 -0
- package/okf/entities/invitations.md +53 -0
- package/okf/entities/items.md +95 -0
- package/okf/entities/ledgers.md +56 -0
- package/okf/entities/likes.md +40 -0
- package/okf/entities/links.md +70 -0
- package/okf/entities/mailinglists.md +67 -0
- package/okf/entities/mailingrecipients.md +45 -0
- package/okf/entities/mailservers.md +77 -0
- package/okf/entities/messagereads.md +40 -0
- package/okf/entities/messages.md +104 -0
- package/okf/entities/notes.md +73 -0
- package/okf/entities/objects.md +70 -0
- package/okf/entities/opportunities.md +87 -0
- package/okf/entities/participants.md +52 -0
- package/okf/entities/payments.md +76 -0
- package/okf/entities/permissions.md +46 -0
- package/okf/entities/pricelists.md +70 -0
- package/okf/entities/pricelists2accounts.md +46 -0
- package/okf/entities/prices.md +49 -0
- package/okf/entities/projects.md +72 -0
- package/okf/entities/records.md +75 -0
- package/okf/entities/relateditems.md +43 -0
- package/okf/entities/resources.md +55 -0
- package/okf/entities/services.md +64 -0
- package/okf/entities/stocktransactions.md +72 -0
- package/okf/entities/storages.md +56 -0
- package/okf/entities/suppliers.md +51 -0
- package/okf/entities/tasks.md +86 -0
- package/okf/entities/tickets.md +86 -0
- package/okf/entities/transactions.md +118 -0
- package/okf/entities/users.md +66 -0
- package/okf/entities/weblets.md +66 -0
- package/okf/index.md +11 -0
- package/okf/log.md +4 -0
- package/okf/metrics/cash-received.md +10 -0
- package/okf/metrics/index.md +6 -0
- package/okf/metrics/invoiced-net-revenue.md +16 -0
- package/okf/metrics/open-customers.md +14 -0
- package/okf/metrics/overdue-receivables.md +12 -0
- package/okf/playbooks/customer-360.md +12 -0
- package/okf/playbooks/index.md +5 -0
- package/okf/playbooks/revenue-this-year.md +19 -0
- package/okf/playbooks/ticket-work-packet.md +11 -0
- package/package.json +9 -5
- package/scripts/data/okf-curation.mjs +258 -0
- package/scripts/generate-client.mjs +4 -275
- package/scripts/generate-okf.mjs +241 -0
- package/scripts/lib/okf.mjs +272 -0
- package/scripts/lib/spec-model.mjs +325 -0
- package/src/index.js +4 -0
- package/src/runtime/client.js +199 -18
- package/src/runtime/okf.js +237 -0
- package/samples/missioncontrol/README.md +0 -106
- package/samples/missioncontrol/fetch-data.mjs +0 -341
- package/samples/missioncontrol/index.html +0 -419
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,43 @@
|
|
|
3
3
|
Notable changes to `@zeyos/client` and `@zeyos/cli`. This project follows
|
|
4
4
|
[Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## 0.4.0
|
|
7
|
+
|
|
8
|
+
### Open Knowledge Format (OKF)
|
|
9
|
+
- **New OKF bundle** under [`okf/`](okf/): a conformant [Open Knowledge Format v0.1](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md) description of the ZeyOS data model — one Markdown concept per API-backed entity (schema, foreign keys, enums, indexes, and the real operationIds), plus curated metrics, playbooks, and cross-cutting query concepts. Generated from the OpenAPI/dbref specs into **managed blocks** so structural content stays in sync while curated `# Notes` are preserved across regeneration. Ships in the npm package.
|
|
10
|
+
- **Canonical schema source**: the previously hand-maintained operationId table in `agents/shared/zeyos-entity-reference.md` is now generated from the bundle, so the skill pack and the data model can't drift apart. Skills stay the task-facing layer; OKF is the reference layer.
|
|
11
|
+
- **Freshness**: `npm run generate` regenerates the bundle alongside the client; a `source_snapshot` hash and an auto-appended `okf/log.md` schema-diff track changes when the ZeyOS schema/API is updated, and `npm run okf:check` is a CI drift + conformance gate.
|
|
12
|
+
|
|
13
|
+
### `@zeyos/client`
|
|
14
|
+
- New OKF exports: `buildOkf()` (synthesize a conformant bundle from the client's schema — pure, browser-safe), `loadOkfBundle(dir)` (read a bundle, Node), `validateOkfBundle`/`validateOkfFiles` (OKF v0.1 conformance), `conceptIdForResource`, and `OKF_VERSION`.
|
|
15
|
+
|
|
16
|
+
### `@zeyos/cli` (`zeyos`)
|
|
17
|
+
- New `okf` command: `zeyos okf list | show <concept> | check | export [--out] | build [--out]` to browse, print, validate, vendor, or synthesize the OKF bundle.
|
|
18
|
+
|
|
19
|
+
### Agent skills & tooling
|
|
20
|
+
- The improvement loop gains a `--context skills|okf|both` axis (`run.mjs`/`loop.mjs`) to measure whether OKF-as-context lifts agent accuracy, and a new `okf:refine` loop (`refine-okf.mjs`) that drafts → validates against the schema → judges → applies improvements to a concept's curated notes (never the generated managed block).
|
|
21
|
+
|
|
22
|
+
## 0.3.0
|
|
23
|
+
|
|
24
|
+
### `@zeyos/client`
|
|
25
|
+
- **Single-flight token refresh**: when several operations notice an expired access token at once (e.g. `Promise.all([...])`), they now share a single `getToken` refresh instead of each firing its own — avoiding redundant calls and the hard failure that refresh-token rotation would otherwise cause.
|
|
26
|
+
- **Request timeout**: a new `timeoutMs` option (client-wide via `config.timeoutMs`, or per request) bounds each attempt via an `AbortController` composed with any caller `signal`. Timeouts reject with `isTimeout === true` / `code === 'ETIMEDOUT'` and are distinct from a caller abort (which always propagates and is never retried).
|
|
27
|
+
- **Network-error retries (reads only)**: dropped connections / timeouts are now retried within the retry budget for safe read operations (`GET`/`HEAD` + side-effect-free `list`/`count`/`search`); writes are never auto-retried. Override per request or client with `retryOnNetworkError`.
|
|
28
|
+
- **Auto-pagination**: `client.paginate(operationId, input, opts)` async-iterates every matching record by paging on `offset` (page size clamped to the 10000 server max), and `client.collect(...)` is the eager array form — removing the manual offset bookkeeping the list caps otherwise force.
|
|
29
|
+
- **Richer error messages**: `ZeyosApiError.message` now folds in a short snippet of the server error body (e.g. `… failed with HTTP 400: unknown filter field: bogus`); the full body remains on `error.body`.
|
|
30
|
+
|
|
31
|
+
### `@zeyos/cli` (`zeyos`)
|
|
32
|
+
- **Named credential profiles**: store multiple ZeyOS instances and switch between them. `zeyos profile list | current | use <name> [--local] | add <name> [--base-url/--client-id/--secret | --from-current] | remove <name>`, a global `--profile <name>` flag on every command, and `ZEYOS_PROFILE`. Profiles live in `~/.config/zeyos/profiles.json` with an active pointer; a project can pin one via `.zeyos/profile`. Resolution: `--profile` > `ZEYOS_PROFILE` > project pin > legacy `.zeyos/auth.json` > global active > legacy global. Fully backward compatible.
|
|
33
|
+
- `login --profile <name>` authenticates into (and activates) a named profile; `logout` is profile-aware; refreshed tokens persist back to whichever store they came from.
|
|
34
|
+
- `login` now detects an **expired** stored token and re-authenticates instead of reporting "already logged in"; `whoami` surfaces `502/503/504` as "instance temporarily unavailable" and `401` as an expired-session hint, instead of a raw status.
|
|
35
|
+
|
|
36
|
+
### Agent skills
|
|
37
|
+
- New **`zeyos-time-tracking`** skill: first-person work views ("what are my current tickets/tasks?") and interactive time logging ("log 60 minutes for client XYZ" → resolve account → pick ticket/task → write effort as an actionstep), plus timesheet summaries and entry corrections.
|
|
38
|
+
|
|
6
39
|
## 0.2.0
|
|
7
40
|
|
|
8
41
|
### `@zeyos/client`
|
|
9
42
|
- Added a `dryRun` request option: `client.api.*`, `client.request()`, etc. return a resolved `{ dryRun, method, url, body, bodyType, … }` descriptor without performing any network request or token work. Powers the CLI `--query` flag and is handy for debugging and tests.
|
|
10
|
-
- Packaging: the published tarball now lists sample paths explicitly, so the generated `samples/missioncontrol/data.js` / `data.json` (which can contain real instance data) are never shipped to npm.
|
|
11
43
|
|
|
12
44
|
### `@zeyos/cli` (`zeyos`)
|
|
13
45
|
- New `doctor agent` command: an offline readiness check for coding agents — reports CLI version, configured base URL/instance, whether auth is present via environment/local/global config, and resource-registry health. Never prints tokens or client secrets.
|
|
@@ -19,9 +51,6 @@ Notable changes to `@zeyos/client` and `@zeyos/cli`. This project follows
|
|
|
19
51
|
- Skill packs are self-contained: each domain `SKILL.md` now points at a shared operating guide (`agents/shared/zeyos-agent-operating-guide.md`) with a bare-skill checklist and shell-safe command hygiene (inline single-quoted JSON, `--filter-file`/`--data-file`, counts via `zeyos count`).
|
|
20
52
|
- Added an entity-noun → REST `operationId` reference and per-domain workflow notes (first-command examples for counts, `visibility`-column caveats, and the diverging dunning operationIds).
|
|
21
53
|
|
|
22
|
-
### Samples
|
|
23
|
-
- New `samples/missioncontrol` team-performance dashboard: a read-only Node fetcher (`fetch-data.mjs`) plus a static, dependency-free `index.html`. The generated data files are git-ignored and excluded from the npm package.
|
|
24
|
-
|
|
25
54
|
### Docs
|
|
26
55
|
- Documented `--filter-file`/`--data-file` and the new `doctor` command across the CLI getting-started and command reference.
|
|
27
56
|
|
package/README.md
CHANGED
|
@@ -203,6 +203,7 @@ zeyos <command> [options] [args…]
|
|
|
203
203
|
| `resources` | List resource types the CLI exposes | `zeyos resources --json` |
|
|
204
204
|
| `describe <resource>` | Show a resource's fields, types and enums | `zeyos describe ticket` |
|
|
205
205
|
| `skills <list\|show\|install>` | Manage bundled coding-agent skills | `zeyos skills install --target claude --global` |
|
|
206
|
+
| `okf <list\|show\|check\|export\|build>` | Work with the OKF knowledge bundle | `zeyos okf show tickets` |
|
|
206
207
|
|
|
207
208
|
**Global options** (work on every command): `--json`, `--yaml`, `--no-color`, `-h/--help`, `-v/--version`.
|
|
208
209
|
|
|
@@ -405,6 +406,33 @@ See [Agent Workflows](./docs/04-agent-workflows/00-coding-agents.md): [quickstar
|
|
|
405
406
|
|
|
406
407
|
---
|
|
407
408
|
|
|
409
|
+
## Open Knowledge Format (OKF)
|
|
410
|
+
|
|
411
|
+
The client ships a conformant [**Open Knowledge Format**](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md)
|
|
412
|
+
bundle under [`okf/`](./okf/) — a portable, Git-native Markdown description of the ZeyOS data
|
|
413
|
+
model (one concept per API-backed entity: schema, foreign keys, enums, indexes, operationIds)
|
|
414
|
+
plus curated metrics, playbooks, and query concepts. Agents and tools read it as a shared
|
|
415
|
+
knowledge layer, independent of this client.
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
zeyos okf list # browse concepts
|
|
419
|
+
zeyos okf show tickets # print a concept (schema + curated notes)
|
|
420
|
+
zeyos okf check # validate OKF v0.1 conformance
|
|
421
|
+
zeyos okf export --out ./okf # vendor the bundle into your project
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
```js
|
|
425
|
+
import { buildOkf, loadOkfBundle, validateOkfBundle } from '@zeyos/client';
|
|
426
|
+
const files = buildOkf(); // synthesize from the client schema
|
|
427
|
+
const bundle = await loadOkfBundle('node_modules/@zeyos/client/okf');
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
The bundle is **generated** from the OpenAPI/dbref specs into managed blocks, with curated
|
|
431
|
+
prose preserved across regeneration, and it is **canonical** for structural facts (the shared
|
|
432
|
+
skill references derive from it). It is regenerated by `npm run generate` and gated by
|
|
433
|
+
`npm run okf:check`. See the [OKF docs](./docs/06-okf/01-overview.md) for the bundle layout,
|
|
434
|
+
the spec-refresh runbook, and how it ties into the [skill-improvement loops](./docs/06-okf/04-loops.md).
|
|
435
|
+
|
|
408
436
|
## Sample apps
|
|
409
437
|
|
|
410
438
|
Three runnable, dependency-free browser demos live in [`samples/`](./samples/):
|
|
@@ -423,9 +451,10 @@ Each can be served as static files from the repository root; see the linked docs
|
|
|
423
451
|
- [`cli/`](./cli/) — the `@zeyos/cli` command-line tool.
|
|
424
452
|
- [`docs/`](./docs/) — the authoritative documentation (Docusaurus).
|
|
425
453
|
- [`agents/`](./agents/) — repo-local ZeyOS agent skills and query playbooks.
|
|
454
|
+
- [`okf/`](./okf/) — the [Open Knowledge Format](./docs/06-okf/01-overview.md) bundle: a portable, Git-native Markdown description of the ZeyOS data model (canonical for structural facts).
|
|
426
455
|
- [`openapi/`](./openapi/) — the OpenAPI specifications and DB schema reference.
|
|
427
456
|
- [`samples/`](./samples/) — the sample browser applications.
|
|
428
|
-
- [`scripts/`](./scripts/) — client generation (`generate-client.mjs`) and the test runner.
|
|
457
|
+
- [`scripts/`](./scripts/) — client + OKF generation (`generate-client.mjs`, `generate-okf.mjs`) and the test runner.
|
|
429
458
|
|
|
430
459
|
---
|
|
431
460
|
|
|
@@ -439,6 +468,7 @@ Each can be served as static files from the repository root; see the linked docs
|
|
|
439
468
|
| **Agent Workflows** | CLI-first agent orientation, JSON recipes, escalation | [docs/04-agent-workflows](./docs/04-agent-workflows/00-coding-agents.md) |
|
|
440
469
|
| **Sample Apps** | Kanban, CRM, Dashboard walkthroughs | [docs/04-sample-apps](./docs/04-sample-apps/01-kanban.md) |
|
|
441
470
|
| **Tutorials** | Architecture guide, build-your-own frontend, server-side integration | [docs/05-tutorials](./docs/05-tutorials/00-application-developers.md) |
|
|
471
|
+
| **Open Knowledge Format** | The OKF knowledge bundle: overview, producing/consuming, keeping it fresh, refinement loops | [docs/06-okf](./docs/06-okf/01-overview.md) |
|
|
442
472
|
| **Agent Skills** | What the bundled skills do and how they're organized | [agents/README.md](./agents/README.md) |
|
|
443
473
|
|
|
444
474
|
---
|
package/agents/README.md
CHANGED
|
@@ -5,6 +5,8 @@ This folder contains a repo-local skill pack for coding agents that use ZeyOS as
|
|
|
5
5
|
The source-backed model reference lives in [`shared/zeyos-entity-reference.md`](./shared/zeyos-entity-reference.md) and is derived from [`openapi/dbref.json`](../openapi/dbref.json) and [`openapi/api.json`](../openapi/api.json).
|
|
6
6
|
Cross-platform modeling guidance lives in [`shared/business-app-benchmarks.md`](./shared/business-app-benchmarks.md).
|
|
7
7
|
|
|
8
|
+
The **canonical** per-entity schema (columns, types, enums, foreign keys, indexes, operationIds) now lives in the [Open Knowledge Format bundle](../okf/entities/index.md) under [`okf/`](../okf/), generated from the same specs; the shared reference's operationId table is generated from it. Cross-cutting query rules and footguns are in [`okf/concepts/`](../okf/concepts/index.md). When a schema fact in a shared reference and in `okf/` disagree, `okf/` wins.
|
|
9
|
+
|
|
8
10
|
## Structure
|
|
9
11
|
|
|
10
12
|
- `shared/` contains cross-domain query rules and entity relationships, including
|
|
@@ -15,6 +17,7 @@ Cross-platform modeling guidance lives in [`shared/business-app-benchmarks.md`](
|
|
|
15
17
|
the authenticated `zeyos` CLI. Use it when a request touches ZeyOS data and no
|
|
16
18
|
domain-specific skill clearly fits.
|
|
17
19
|
- `zeyos-work-management/` handles tasks, projects, tickets, and assignee workload questions.
|
|
20
|
+
- `zeyos-time-tracking/` handles first-person work views ("my tickets/tasks") and interactive time logging (resolve account, pick the ticket/task, write the effort as an actionstep).
|
|
18
21
|
- `zeyos-mail-operations/` handles message lookup, email summaries, threads, and safe draft workflows.
|
|
19
22
|
- `zeyos-billing-insights/` handles transactions, payments, invoices, credits, and revenue questions.
|
|
20
23
|
- `zeyos-notes-and-sops/` handles notes, SOP discovery, documents, and file-backed knowledge lookup.
|
|
@@ -42,6 +45,7 @@ Cross-platform modeling guidance lives in [`shared/business-app-benchmarks.md`](
|
|
|
42
45
|
|------|----------|-----------------|
|
|
43
46
|
| `zeyos` | General-purpose ZeyOS access via the CLI; the catch-all when no domain skill fits | "How many open customers do we have?"; "List the 10 most recently modified tickets."; "Show me account 122." |
|
|
44
47
|
| `zeyos-work-management` | Operational work queues, user workload, ticket-task-project tracing, follow-up work creation | "On which projects did Max Power work in the last two weeks?"; "Show overdue high-priority tickets for account ACME."; "What open tasks are blocking Project Atlas?" |
|
|
48
|
+
| `zeyos-time-tracking` | First-person work views and interactive time logging (resolve account → pick ticket/task → write effort as an actionstep) | "What are my current tickets?"; "Show my open tasks."; "Log 60 minutes for client XYZ."; "Record 2 hours on ticket 812." |
|
|
45
49
|
| `zeyos-mail-operations` | Customer mail summaries, thread reconstruction, draft preparation, mailbox analysis | "Give me a summary of all recent mails from customer XYZ."; "Which open tickets have unanswered customer emails?"; "Draft a reply to the latest complaint from ACME." |
|
|
46
50
|
| `zeyos-billing-insights` | Revenue, invoices, credits, payment tracking, transaction-level finance questions | "What is our net invoiced revenue this year?"; "How much cash did we collect this quarter?"; "Show all billing activity for customer XYZ." |
|
|
47
51
|
| `zeyos-notes-and-sops` | SOP retrieval, note summaries, final-document lookup, attachment discovery | "Find the current escalation SOP for billing disputes."; "Summarize our notes on failed invoice syncs."; "Which finalized onboarding SOP changed last month?" |
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Use this file when a question spans more than one business area.
|
|
4
4
|
|
|
5
|
-
This is the high-level relationship map. For the
|
|
5
|
+
This is the high-level relationship map (curated). For the per-entity schema — columns, enums,
|
|
6
|
+
foreign keys, indexes, and operationIds — read the canonical [`okf/entities/`](../../okf/entities/index.md)
|
|
7
|
+
concepts; for cross-cutting query rules read [`okf/concepts/`](../../okf/concepts/index.md). The
|
|
8
|
+
source-backed inventory and the generated operationId table live in
|
|
9
|
+
[zeyos-entity-reference.md](./zeyos-entity-reference.md), derived from [../../openapi/dbref.json](../../openapi/dbref.json) and [../../openapi/api.json](../../openapi/api.json).
|
|
6
10
|
|
|
7
11
|
The names below are dbref/DB-table nouns used to describe relationships. They are **not** the
|
|
8
12
|
`@zeyos/client` operationIds. Several diverge (e.g. `dunning` -> `listDunningNotices`,
|
|
@@ -14,6 +14,13 @@ Current source snapshot:
|
|
|
14
14
|
|
|
15
15
|
Use this file when you need to understand what an entity is for before building a query plan.
|
|
16
16
|
|
|
17
|
+
> **Canonical schema lives in the OKF bundle.** Per-entity columns, types, enums, foreign keys,
|
|
18
|
+
> indexes (incl. the GIN/partial indexes behind the `filters` footgun), and operationIds are
|
|
19
|
+
> generated into [`okf/entities/`](../../okf/entities/index.md) from the specs, and cross-cutting
|
|
20
|
+
> rules into [`okf/concepts/`](../../okf/concepts/index.md). This reference keeps the curated
|
|
21
|
+
> narrative (entity families, query priorities, use-case clusters); the operationId table below is
|
|
22
|
+
> generated from the same source. When schema facts here and in `okf/` ever disagree, `okf/` wins.
|
|
23
|
+
|
|
17
24
|
## Source Note: `filter` vs `filters`
|
|
18
25
|
|
|
19
26
|
Do not treat the spelling as universally settled.
|
|
@@ -58,39 +65,88 @@ Entities that follow the regular rule directly (lowercase noun, single English w
|
|
|
58
65
|
|
|
59
66
|
`*` = read-only entity: only `list*`, `get*`, and `exists*` exist (no create/update/delete).
|
|
60
67
|
|
|
61
|
-
###
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
|
74
|
-
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
### The authoritative table (generated from `openapi/api.json`)
|
|
69
|
+
|
|
70
|
+
The full `list`/`get`/`create`/`update`/`delete`/`exists` operationId for **every** API-backed
|
|
71
|
+
entity is generated below and kept in sync with the specs by `scripts/generate-okf.mjs`. The
|
|
72
|
+
tricky cases all appear with their real operationIds: junction tables (`X2Y` → `XToY`, often
|
|
73
|
+
re-pluralizing the left side), renamed entities (`dunning` → `DunningNotice`), compounds that
|
|
74
|
+
keep internal capitalization (`MailingLists`, not `Mailinglists`), and quirks like `listCategorys`
|
|
75
|
+
(sic) or the plural `existsMailingRecipients`. A `—` means the operation does not exist
|
|
76
|
+
(read-only or list-only entity). Per-entity schema, enums, and foreign keys live in the matching
|
|
77
|
+
[`okf/entities/<name>.md`](../../okf/entities/index.md) concept, which is the canonical source.
|
|
78
|
+
|
|
79
|
+
<!-- okf:generated:start — rewritten by scripts/generate-okf.mjs; do not edit by hand -->
|
|
80
|
+
| Entity | Concept | list | get | create | update | delete | exists |
|
|
81
|
+
|---|---|---|---|---|---|---|---|
|
|
82
|
+
| `accounts` | [↗](../../okf/entities/accounts.md) | `listAccounts` | `getAccount` | `createAccount` | `updateAccount` | `deleteAccount` | `existsAccount` |
|
|
83
|
+
| `actionsteps` | [↗](../../okf/entities/actionsteps.md) | `listActionSteps` | `getActionStep` | `createActionStep` | `updateActionStep` | `deleteActionStep` | `existsActionStep` |
|
|
84
|
+
| `addresses` | [↗](../../okf/entities/addresses.md) | `listAddresses` | `getAddress` | `createAddress` | `updateAddress` | `deleteAddress` | `existsAddress` |
|
|
85
|
+
| `applicationassets` | [↗](../../okf/entities/applicationassets.md) | `listApplicationAssets` | `getApplicationAsset` | — | — | — | `existsApplicationAsset` |
|
|
86
|
+
| `applications` | [↗](../../okf/entities/applications.md) | `listApplications` | `getApplication` | — | — | — | `existsApplication` |
|
|
87
|
+
| `appointments` | [↗](../../okf/entities/appointments.md) | `listAppointments` | `getAppointment` | `createAppointment` | `updateAppointment` | `deleteAppointment` | `existsAppointment` |
|
|
88
|
+
| `associations` | [↗](../../okf/entities/associations.md) | `listAssociations` | `getAssociation` | `createAssociation` | `updateAssociation` | `deleteAssociation` | `existsAssociation` |
|
|
89
|
+
| `binfiles` | [↗](../../okf/entities/binfiles.md) | `listBinFiles` | — | — | — | — | — |
|
|
90
|
+
| `campaigns` | [↗](../../okf/entities/campaigns.md) | `listCampaigns` | `getCampaign` | `createCampaign` | `updateCampaign` | `deleteCampaign` | `existsCampaign` |
|
|
91
|
+
| `categories` | [↗](../../okf/entities/categories.md) | `listCategorys` | `getCategory` | `createCategory` | `updateCategory` | `deleteCategory` | `existsCategory` |
|
|
92
|
+
| `channels` | [↗](../../okf/entities/channels.md) | `listChannels` | `getChannel` | `createChannel` | `updateChannel` | `deleteChannel` | `existsChannel` |
|
|
93
|
+
| `comments` | [↗](../../okf/entities/comments.md) | `listComments` | `getComment` | `createComment` | `updateComment` | `deleteComment` | `existsComment` |
|
|
94
|
+
| `components` | [↗](../../okf/entities/components.md) | `listComponents` | `getComponent` | `createComponent` | `updateComponent` | `deleteComponent` | `existsComponent` |
|
|
95
|
+
| `contacts` | [↗](../../okf/entities/contacts.md) | `listContacts` | `getContact` | `createContact` | `updateContact` | `deleteContact` | `existsContact` |
|
|
96
|
+
| `contacts2contacts` | [↗](../../okf/entities/contacts2contacts.md) | `listContactsToContacts` | `getContactToContact` | `createContactToContact` | `updateContactToContact` | `deleteContactToContact` | `existsContactToContact` |
|
|
97
|
+
| `contracts` | [↗](../../okf/entities/contracts.md) | `listContracts` | `getContract` | `createContract` | `updateContract` | `deleteContract` | `existsContract` |
|
|
98
|
+
| `couponcodes` | [↗](../../okf/entities/couponcodes.md) | `listCouponCodes` | `getCouponCode` | `createCouponCode` | `updateCouponCode` | `deleteCouponCode` | `existsCouponCode` |
|
|
99
|
+
| `coupons` | [↗](../../okf/entities/coupons.md) | `listCoupons` | `getCoupon` | `createCoupon` | `updateCoupon` | `deleteCoupon` | `existsCoupon` |
|
|
100
|
+
| `customfields` | [↗](../../okf/entities/customfields.md) | `listCustomFields` | `getCustomField` | — | — | — | `existsCustomField` |
|
|
101
|
+
| `davservers` | [↗](../../okf/entities/davservers.md) | `listDAVServers` | `getDAVServer` | `createDAVServer` | `updateDAVServer` | `deleteDAVServer` | `existsDAVServer` |
|
|
102
|
+
| `devices` | [↗](../../okf/entities/devices.md) | `listDevices` | `getDevice` | `createDevice` | `updateDevice` | `deleteDevice` | `existsDevice` |
|
|
103
|
+
| `documents` | [↗](../../okf/entities/documents.md) | `listDocuments` | `getDocument` | `createDocument` | `updateDocument` | `deleteDocument` | `existsDocument` |
|
|
104
|
+
| `dunning` | [↗](../../okf/entities/dunning.md) | `listDunningNotices` | `getDunningNotice` | `createDunningNotice` | `updateDunningNotice` | `deleteDunningNotice` | `existsDunningNotice` |
|
|
105
|
+
| `dunning2transactions` | [↗](../../okf/entities/dunning2transactions.md) | `listDunningToTransactions` | `getDunningToTransaction` | `createDunningToTransaction` | `updateDunningToTransaction` | `deleteDunningToTransaction` | `existsDunningToTransaction` |
|
|
106
|
+
| `entities2channels` | [↗](../../okf/entities/entities2channels.md) | `listEntitiesToChannels` | `getEntityToChannel` | `createEntityToChannel` | `updateEntityToChannel` | `deleteEntityToChannel` | `existsEntityToChannel` |
|
|
107
|
+
| `events` | [↗](../../okf/entities/events.md) | `listEvents` | `getEvent` | `createEvent` | `updateEvent` | `deleteEvent` | `existsEvent` |
|
|
108
|
+
| `feedservers` | [↗](../../okf/entities/feedservers.md) | `listFeedServers` | `getFeedServer` | `createFeedServer` | `updateFeedServer` | `deleteFeedServer` | `existsFeedServer` |
|
|
109
|
+
| `files` | [↗](../../okf/entities/files.md) | `listFiles` | `getFile` | `createFile` | `updateFile` | `deleteFile` | `existsFile` |
|
|
110
|
+
| `follows` | [↗](../../okf/entities/follows.md) | `listFollows` | `getFollow` | `createFollow` | `updateFollow` | `deleteFollow` | `existsFollow` |
|
|
111
|
+
| `forks` | [↗](../../okf/entities/forks.md) | `listForks` | `getFork` | — | — | — | `existsFork` |
|
|
112
|
+
| `groups` | [↗](../../okf/entities/groups.md) | `listGroups` | `getGroup` | — | — | — | `existsGroup` |
|
|
113
|
+
| `groups2users` | [↗](../../okf/entities/groups2users.md) | `listGroupsToUsers` | `getGroupToUser` | — | — | — | `existsGroupToUser` |
|
|
114
|
+
| `invitations` | [↗](../../okf/entities/invitations.md) | `listInvitations` | `getInvitation` | `createInvitation` | `updateInvitation` | `deleteInvitation` | `existsInvitation` |
|
|
115
|
+
| `items` | [↗](../../okf/entities/items.md) | `listItems` | `getItem` | `createItem` | `updateItem` | `deleteItem` | `existsItem` |
|
|
116
|
+
| `ledgers` | [↗](../../okf/entities/ledgers.md) | `listLedgers` | `getLedger` | `createLedger` | `updateLedger` | `deleteLedger` | `existsLedger` |
|
|
117
|
+
| `likes` | [↗](../../okf/entities/likes.md) | `listLikes` | `getLike` | `createLike` | `updateLike` | `deleteLike` | `existsLike` |
|
|
118
|
+
| `links` | [↗](../../okf/entities/links.md) | `listLinks` | `getLink` | `createLink` | `updateLink` | `deleteLink` | `existsLink` |
|
|
119
|
+
| `mailinglists` | [↗](../../okf/entities/mailinglists.md) | `listMailingLists` | `getMailingList` | `createMailingList` | `updateMailingList` | `deleteMailingList` | `existsMailingList` |
|
|
120
|
+
| `mailingrecipients` | [↗](../../okf/entities/mailingrecipients.md) | `listMailingRecipients` | `getMailingRecipient` | `createMailingRecipient` | `updateMailingRecipient` | `deleteMailingRecipient` | `existsMailingRecipients` |
|
|
121
|
+
| `mailservers` | [↗](../../okf/entities/mailservers.md) | `listMailServers` | `getMailServer` | `createMailServer` | `updateMailServer` | `deleteMailServer` | `existsMailServer` |
|
|
122
|
+
| `messagereads` | [↗](../../okf/entities/messagereads.md) | `listMessageReads` | `getMessageRead` | `createMessageRead` | `updateMessageRead` | `deleteMessageRead` | `existsMessageRead` |
|
|
123
|
+
| `messages` | [↗](../../okf/entities/messages.md) | `listMessages` | `getMessage` | `createMessage` | `updateMessage` | `deleteMessage` | `existsMessage` |
|
|
124
|
+
| `notes` | [↗](../../okf/entities/notes.md) | `listNotes` | `getNote` | `createNote` | `updateNote` | `deleteNote` | `existsNote` |
|
|
125
|
+
| `objects` | [↗](../../okf/entities/objects.md) | `listObjects` | `getObject` | `createObject` | `updateObject` | `deleteObject` | `existsObject` |
|
|
126
|
+
| `opportunities` | [↗](../../okf/entities/opportunities.md) | `listOpportunities` | `getOpportunity` | `createOpportunity` | `updateOpportunity` | `deleteOpportunity` | `existsOpportunity` |
|
|
127
|
+
| `participants` | [↗](../../okf/entities/participants.md) | `listParticipants` | `getParticipant` | `createParticipant` | `updateParticipant` | `deleteParticipant` | `existsParticipant` |
|
|
128
|
+
| `payments` | [↗](../../okf/entities/payments.md) | `listPayments` | `getPayment` | `createPayment` | `updatePayment` | `deletePayment` | `existsPayment` |
|
|
129
|
+
| `permissions` | [↗](../../okf/entities/permissions.md) | `listPermissions` | `getPermission` | — | — | — | `existsPermission` |
|
|
130
|
+
| `pricelists` | [↗](../../okf/entities/pricelists.md) | `listPriceLists` | `getPriceList` | `createPriceList` | `updatePriceList` | `deletePriceList` | `existsPriceList` |
|
|
131
|
+
| `pricelists2accounts` | [↗](../../okf/entities/pricelists2accounts.md) | `listPriceListsToAccounts` | `getPriceListToAccount` | `createPriceListToAccount` | `updatePriceListToAccount` | `deletePriceListToAccount` | `existsPriceListToAccount` |
|
|
132
|
+
| `prices` | [↗](../../okf/entities/prices.md) | `listPrices` | `getPrice` | `createPrice` | `updatePrice` | `deletePrice` | `existsPrice` |
|
|
133
|
+
| `projects` | [↗](../../okf/entities/projects.md) | `listProjects` | `getProject` | `createProject` | `updateProject` | `deleteProject` | `existsProject` |
|
|
134
|
+
| `records` | [↗](../../okf/entities/records.md) | `listRecords` | `getRecord` | `createRecord` | `updateRecord` | `deleteRecord` | `existsRecord` |
|
|
135
|
+
| `relateditems` | [↗](../../okf/entities/relateditems.md) | `listRelatedItems` | `getRelatedItem` | `createRelatedItem` | `updateRelatedItem` | `deleteRelatedItem` | `existsRelatedItem` |
|
|
136
|
+
| `resources` | [↗](../../okf/entities/resources.md) | `listResources` | `getResource` | — | — | — | `existsResource` |
|
|
137
|
+
| `services` | [↗](../../okf/entities/services.md) | `listServices` | `getService` | — | — | — | `existsService` |
|
|
138
|
+
| `stocktransactions` | [↗](../../okf/entities/stocktransactions.md) | `listStockTransactions` | `getStockTransaction` | `createStockTransaction` | `updateStockTransaction` | `deleteStockTransaction` | `existsStockTransaction` |
|
|
139
|
+
| `storages` | [↗](../../okf/entities/storages.md) | `listStorages` | `getStorage` | `createStorage` | `updateStorage` | `deleteStorage` | `existsStorage` |
|
|
140
|
+
| `suppliers` | [↗](../../okf/entities/suppliers.md) | `listSuppliers` | `getSupplier` | `createSupplier` | `updateSupplier` | `deleteSupplier` | `existsSupplier` |
|
|
141
|
+
| `tasks` | [↗](../../okf/entities/tasks.md) | `listTasks` | `getTask` | `createTask` | `updateTask` | `deleteTask` | `existsTask` |
|
|
142
|
+
| `tickets` | [↗](../../okf/entities/tickets.md) | `listTickets` | `getTicket` | `createTicket` | `updateTicket` | `deleteTicket` | `existsTicket` |
|
|
143
|
+
| `transactions` | [↗](../../okf/entities/transactions.md) | `listTransactions` | `getTransaction` | `createTransaction` | `updateTransaction` | `deleteTransaction` | `existsTransaction` |
|
|
144
|
+
| `users` | [↗](../../okf/entities/users.md) | `listUsers` | `getUser` | — | — | — | `existsUser` |
|
|
145
|
+
| `weblets` | [↗](../../okf/entities/weblets.md) | `listWeblets` | `getWeblet` | — | — | — | `existsWeblet` |
|
|
146
|
+
<!-- okf:generated:end -->
|
|
147
|
+
|
|
148
|
+
When in doubt, read the entity's OKF concept (linked above) or look the operationId up in
|
|
149
|
+
`openapi/api.json` rather than constructing it from the noun.
|
|
94
150
|
|
|
95
151
|
## API-Backed Entities
|
|
96
152
|
|
|
@@ -25,9 +25,15 @@ Typical prompts:
|
|
|
25
25
|
4. Pull message `text` only when you actually need a summary or draft context.
|
|
26
26
|
5. Group related mail using `reference`, `messageid`, and normalized subject.
|
|
27
27
|
6. If the request is about campaigns, mailing lists, participant coverage, or mailing performance, switch to `zeyos-campaign-and-outreach`.
|
|
28
|
-
7. Treat drafts as safe write
|
|
28
|
+
7. Treat textual drafts as safe. Treat message record creation/update as a write and sending or marking `mailbox=2` as high risk; require explicit confirmation plus verified sender context before any real mail mutation.
|
|
29
29
|
8. Escalate to `@zeyos/client` when you need binary content, MIME expansion, or richer message correlation than the CLI can express cleanly.
|
|
30
30
|
|
|
31
|
+
## Safety
|
|
32
|
+
|
|
33
|
+
- Never send email from an agent test or from a summary/draft request.
|
|
34
|
+
- Do not create or update message records unless the user explicitly asks for a real ZeyOS draft and the sender/mailserver context is known.
|
|
35
|
+
- For "draft a reply", produce reply text in the response and leave ZeyOS unchanged.
|
|
36
|
+
|
|
31
37
|
## Output Discipline
|
|
32
38
|
|
|
33
39
|
- Report the resolved customer identity and the email addresses used for matching.
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
- `0` = inbox
|
|
6
6
|
- `1` = drafts
|
|
7
7
|
- `2` = sent
|
|
8
|
+
- `3` = templates
|
|
9
|
+
- `4` = mailings
|
|
8
10
|
- `5` = archive
|
|
9
11
|
- `6` = trash
|
|
10
12
|
- `7` = junk
|
|
@@ -68,6 +70,17 @@ Recommended approach:
|
|
|
68
70
|
3. Use `reference` and `messageid` to confirm direct reply relationships.
|
|
69
71
|
4. Use subject matching only as a fallback.
|
|
70
72
|
|
|
73
|
+
CLI example:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
zeyos list messages \
|
|
77
|
+
--fields ID,date,mailbox,subject,sender_email,to_email,ticket,reference,messageid \
|
|
78
|
+
--filter '{"ticket":812}' \
|
|
79
|
+
--sort +date \
|
|
80
|
+
--limit 100 \
|
|
81
|
+
--json
|
|
82
|
+
```
|
|
83
|
+
|
|
71
84
|
## Pattern: Find Unanswered Customer Mail
|
|
72
85
|
|
|
73
86
|
Use this for prompts like:
|
|
@@ -80,9 +93,11 @@ Recommended approach:
|
|
|
80
93
|
1. Start from recent inbox messages (`mailbox = 0`).
|
|
81
94
|
2. Limit to customer identities you can resolve through contacts or linked tickets.
|
|
82
95
|
3. Group by thread using `reference`, `messageid`, and subject.
|
|
83
|
-
4. Look for a later sent message (`mailbox = 2`) in the same thread.
|
|
96
|
+
4. Look for a later sent message (`mailbox = 2`) in the same thread. The strongest match is `sent.reference == inbound.ID`; subject matching is only a fallback.
|
|
84
97
|
5. Report unresolved threads and their linked tickets if available.
|
|
85
98
|
|
|
99
|
+
For an operational count, use this exact definition unless the user specifies another one: inbox message (`mailbox = 0`) linked to an open ticket, with no later sent message (`mailbox = 2`) whose `reference` points back to that inbound message.
|
|
100
|
+
|
|
86
101
|
## Pattern: Draft A Reply
|
|
87
102
|
|
|
88
103
|
Use this for prompts like:
|
|
@@ -95,12 +110,14 @@ Recommended approach:
|
|
|
95
110
|
1. Summarize the relevant thread first.
|
|
96
111
|
2. Extract the action items, commitments, and unresolved questions.
|
|
97
112
|
3. Draft reply text separately from any ZeyOS mutation.
|
|
98
|
-
4. Create or update a draft message only if the user explicitly asks and the required sender context is known.
|
|
113
|
+
4. Create or update a draft message only if the user explicitly asks for a real ZeyOS draft and the required sender/mailserver context is known.
|
|
99
114
|
|
|
100
115
|
Important caveat:
|
|
101
116
|
|
|
102
117
|
- Creating a real draft may require more than subject and body. Inspect an existing draft or the instance-specific sending setup before writing message records.
|
|
118
|
+
- Do not set `messageid` when creating test/draft messages; the API may reject it even though list/get responses can expose the field.
|
|
103
119
|
- Never send email just because a user asked for a summary or a draft.
|
|
120
|
+
- In agent protocol tests, "draft" means text output only. Do not call `createMessage`, `updateMessage`, or any send/dispatch path unless the scenario explicitly asks for a real draft record.
|
|
104
121
|
|
|
105
122
|
## Common Failure Modes
|
|
106
123
|
|
|
@@ -26,7 +26,7 @@ Typical prompts:
|
|
|
26
26
|
3. Use:
|
|
27
27
|
- `applications`, `resources`, `services`, `weblets`, `forks` for platform structure
|
|
28
28
|
- `groups`, `groups2users`, `permissions` for access control (`groups2users` -> `listGroupsToUsers` / `getGroupToUser`)
|
|
29
|
-
- `customfields`, `objects`, and extdata helper families for schema and custom data (`customfields`
|
|
29
|
+
- `customfields`, `objects`, and extdata helper families for schema and custom data (`customfields` is exposed in the CLI as `customfields` for read/count; in the JS client it maps to `listCustomFields`; `applicationassets` -> `listApplicationAssets`; these dbref nouns do not map naively — see [../shared/zeyos-entity-reference.md](../shared/zeyos-entity-reference.md#entity-noun-to-rest-operationid))
|
|
30
30
|
4. Treat `records`, `comments`, `files`, `channels`, `follows`, and `likes` as a collaboration layer. Switch to `zeyos-collaboration-and-activity` when the user asks for timeline or discussion behavior rather than platform structure.
|
|
31
31
|
5. Be explicit when the schema tells you structure but not the product convention.
|
|
32
32
|
|
|
@@ -24,11 +24,27 @@ before calling `@zeyos/client`.
|
|
|
24
24
|
|
|
25
25
|
## First Commands For Counts
|
|
26
26
|
|
|
27
|
-
- All custom fields: `zeyos count customfields`
|
|
28
|
-
- Custom fields for tickets: `zeyos count customfields --filter '{"entity":"tickets"}'`
|
|
29
|
-
|
|
30
|
-
`customfields` has no `visibility` field. In the JS client the list
|
|
31
|
-
`listCustomFields`, not `listCustomfields`.
|
|
27
|
+
- All custom fields: `zeyos count customfields --json`
|
|
28
|
+
- Custom fields for tickets: `zeyos count customfields --filter '{"entity":"tickets"}' --json`
|
|
29
|
+
|
|
30
|
+
`customfields` is read-only and has no `visibility` field. In the JS client the list
|
|
31
|
+
operation is `listCustomFields`, not `listCustomfields`.
|
|
32
|
+
|
|
33
|
+
For a total count, use the `count` value from the CLI JSON response. Do not answer `0`
|
|
34
|
+
because `customfields` is missing from an old CLI registry, because a command failed, or
|
|
35
|
+
because `zeyos resources` did not list it. If `zeyos count customfields` fails with
|
|
36
|
+
"Unknown resource", run `zeyos doctor agent --json` to inspect the CLI version and then
|
|
37
|
+
switch to the JavaScript client:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
node --input-type=module -e 'const { createZeyosClient, normalizeListResult } = await import(`${process.env.ZEYOS_REPO_ROOT}/src/index.js`);
|
|
41
|
+
const client = createZeyosClient({
|
|
42
|
+
platform: process.env.ZEYOS_BASE_URL,
|
|
43
|
+
auth: { mode: "oauth", oauth: { token: { accessToken: process.env.ZEYOS_TOKEN }, autoRefresh: false } }
|
|
44
|
+
});
|
|
45
|
+
const rows = normalizeListResult(await client.api.listCustomFields({ limit: 10000 })).data;
|
|
46
|
+
console.log(rows.length);'
|
|
47
|
+
```
|
|
32
48
|
|
|
33
49
|
## Pattern: Custom Fields For An Entity
|
|
34
50
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zeyos-time-tracking
|
|
3
|
+
description: First-person personal work and interactive time logging in ZeyOS. Use when the user speaks about their own work ("what are my current tickets?", "what's on my plate?", "what am I working on?", "my open tasks", "my action steps") or wants to record/log/book time or effort ("log 60 minutes for client XYZ", "record 2 hours on ticket 812", "book time against Project Atlas"). Resolves the current user, finds the right account and the candidate ticket/task/project to attach time to, confirms the target with the user, then writes the time entry as an actionstep with `effort`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ZeyOS Time Tracking
|
|
7
|
+
|
|
8
|
+
Read [../shared/zeyos-agent-operating-guide.md](../shared/zeyos-agent-operating-guide.md) and [../shared/zeyos-query-patterns.md](../shared/zeyos-query-patterns.md) first. Read [references/workflows.md](references/workflows.md) for the concrete query and write patterns. This skill overlaps with [../zeyos-work-management/SKILL.md](../zeyos-work-management/SKILL.md): use **work-management** for third-person, analytical queries about other people's queues, project tracing, and effort *summaries*; use **time-tracking** when the request is **first-person** ("my …") or is about **recording new time**.
|
|
9
|
+
|
|
10
|
+
Typical prompts:
|
|
11
|
+
|
|
12
|
+
- "What are my current tickets?" / "What's on my plate?" / "What am I working on?"
|
|
13
|
+
- "Show my open tasks." / "What action steps are assigned to me?"
|
|
14
|
+
- "Log 60 minutes of work for client XYZ."
|
|
15
|
+
- "Record 2 hours on ticket 812." / "Book 90 minutes against Project Atlas."
|
|
16
|
+
- "Log half an hour for ACME, I was on a call about the renewal."
|
|
17
|
+
- "How much time did I log this week?" / "Summarize my logged hours by account."
|
|
18
|
+
- "Actually make that 90 minutes, not 60." / "Move that time to ticket 813."
|
|
19
|
+
|
|
20
|
+
## Two jobs
|
|
21
|
+
|
|
22
|
+
1. **Read "my work"** — resolve the current user, then list their open tickets / tasks / action steps. Read-only; just run it.
|
|
23
|
+
2. **Log time (a write)** — resolve *who* the time is for, *what* it attaches to, then create one `actionstep` carrying the effort. This is interactive and confirmed.
|
|
24
|
+
|
|
25
|
+
## The current user
|
|
26
|
+
|
|
27
|
+
The logged-in user's id is `getUserInfo().sub` — a stringified positive integer that **is** the `users.ID`. Get it from `zeyos whoami --json` (read the `sub` field) before any "my …" query, and use it as `assigneduser` on the work resources. Do not guess it and do not ask the user for it.
|
|
28
|
+
|
|
29
|
+
## Interactive discipline (this is the point of the skill)
|
|
30
|
+
|
|
31
|
+
Interactivity here means **act first, then ask only when real data is ambiguous** — never the planning-instead-of-running failure the operating guide warns about.
|
|
32
|
+
|
|
33
|
+
1. **Always run the resolution queries before asking anything.** "I found 3 accounts matching 'XYZ' — which one?" is good (grounded in a query you ran). "Which account do you mean?" with no search behind it is not.
|
|
34
|
+
2. **Ask only when the data is genuinely ambiguous** and the answer changes the write: multiple account matches, or several plausible tickets/tasks. A single unambiguous match needs no question — state it and continue.
|
|
35
|
+
3. **Confirm the target before the write.** Time logging creates a record. The user's "log 60 minutes" authorizes *one* entry; the confirmation is about *where* it lands (which work item) and *what* it says — show the actionstep you are about to create and let the user correct it.
|
|
36
|
+
4. **Never invent the attachment.** If you cannot resolve a confident target and there is no human to ask (e.g. an automated run), stop and report what you found rather than guessing a foreign key for a write.
|
|
37
|
+
|
|
38
|
+
## Safety
|
|
39
|
+
|
|
40
|
+
- Read views are read-only; run them directly.
|
|
41
|
+
- Logging time is a **create**, allowed because the user explicitly asked to log it. Preview with `--query` and confirm the target first; create exactly one record; then read it back.
|
|
42
|
+
- Never delete or bulk-modify time entries on a category ("clear my logged time", "remove old entries") — those are per-record, by id, after preview. See the destructive-operations rules in [../zeyos-work-management/SKILL.md](../zeyos-work-management/SKILL.md).
|
|
43
|
+
|
|
44
|
+
## Output discipline
|
|
45
|
+
|
|
46
|
+
- For "my work": state the resolved user and the open-status definition you used, then the list.
|
|
47
|
+
- For a logged entry: report the created actionstep id, the attached record (ticket/task/account), the effort in minutes, and the date.
|
|
48
|
+
- Separate what you resolved from what you assumed; call out any account or work-item ambiguity you had to break.
|