raynet implementation
Browser API contract
The pure root apiContract.mjs exports the one apiRoutes object for all four existing user GET routes. It owns method/path/access/purpose, JSON transport, existing agent/API-token allowance and canonical Zod query schemas; lib/routes.mjs spreads each descriptor with the original handler. It imports only Zod and the pure entity/operation registry, never credentials, network, handlers or startup code. The host catalog and build-time security projection use this same declaration.
Search and record call req.parseQuery before credentials at their original validation checkpoint. Their schemas reuse the registry's operation resolution and bindPath, retaining entity/binding/ID/sort refusal order and the existing 400 error body. Browser integer defaults/clamps, empty-string coercion, trimmed fulltext/sort, ASC-only direction selection and ignored unknown keys are unchanged. Missing credentials still map to 428 and upstream read failures to 502; status retains its distinct 200 disconnected result. No request body or decoded path input is consumed. Status/catalog query inputs are null, so ignored inputs do not become rejected.
tests/pluginApiIntegrationsPurposes.test.ts checks declaration identity, core registration and handler use of the exact bound schema. tests/raynetRoutes.test.ts uses the selected core's real bound query parsers and asserts browser paging/defaults and upstream path casing. Personal/company credentials, host user-config persistence, accessMode, tools and the native raynetMeetings control remain their existing owners.
Credential settings
The Raynet page is the only editor for personal credentials, declared with userConfigPlacement: "pluginPage". The instance name and the company login are manifest fields marked credential: true, so the host edits them in Settings → Access and leaves them out of the plugin settings editor; the personal-login policy and the access mode remain ordinary plugin settings. The page uses the host's SettingsDocument, SettingsGroup, SettingsRow and Toggle. Its credential group starts closed and preserves the browser's remembered choice under raynet.page.credentials. Opening it or typing does not save.
The personal form validates the masked snapshot, revision and userConfigSchema metadata from GET /plugins/user-config, then mounts the host's existing usePluginConfigDraft with saveMode: 'explicit' and a domain save adapter. Nonsecret controls use setValue; the local password input enters only commitValues on Submit, never draft.values. The host serializes one changed-field batch through PATCH /plugins/raynet/user-config with its current expectedRevision; the adapter preserves company-mode personal fields, trims changed usernames and validates the masked response. It never names an account or uses a separate credential store. Empty keys preserve the stored key; switching to the company account keeps the saved personal username and key. An accepted replacement is removed from the form immediately, including when the following connection test fails.
Save confirmation and connection testing are separate results. Saving explicitly runs the existing GET /plugins/raynet/api/status test; "Test saved credentials" can repeat the test without another write. The status route reports failure: "rejected" for the client's HTTP 401 and failure: "failed" for other test failures. The UI does not infer either from error prose. A failed status or configuration load offers retry instead of guessing the personal-login policy.
A revision conflict retains the draft behind the host controller's synchronous write barrier, including previously retained commit callbacks. Keep edits calls its merge choice, adopting the latest revision while preserving changed local fields and the local key, then requires another explicit save. Unchanged local fields retain concurrent remote changes. Raynet validates conflict snapshots before the controller consumes them. An interrupted or malformed response is unconfirmed and requires reload before another write. Reload unmounts the old form; only a successful authoritative read mounts a fresh controller. A failed reload cannot release the barrier. Typing, folding and unmount never write. Save confirmation is hidden after a new local edit; connection-test results remain independent of persistence.
Personal credentials are used only when allowed and explicitly selected. An incomplete selected personal login is an error, never a fallback to the company account. When personal credentials are disallowed, stored personal values remain intact but are ignored. A run without an account uses company credentials when configured. A run without an account and without company credentials has no Raynet identity and fails with an explicit message.
Owning code: web-src/ConnectPanel.tsx (the form), lib/client.mjs (resolveCredentials, the credential reasons), lib/routes.mjs (the status route), and src/api/routes/plugins/userConfig.ts in core, which stores the values and checks the revision.
The explicit draft consumer requires the coordinated UI API 73 manifest, registration and bundle update. The runtime indexes the published draft-hook and StatusDot types directly, without a local controller or hook alias. The workspace composes the decorative StatusDot with its existing readable status label, retaining the success dot in both connected and disconnected states and the muted label styling. apiJson retains the published PluginApiRequestInit for catalog, search and record reads. The save adapter passes { method: 'PATCH', json: payload } directly to the authenticated host API; the orphan apiPatch wrapper is removed. The host owns serialization and Content-Type; requests without json retain their raw RequestInit bodies. The runtime also exposes the published interpolate type for ConnectPanel and RaynetWorkspace: all known placeholders receive literal string or number values, including dollar sequences, and unknown placeholders remain unchanged. No helper has a local fallback.
Browser route scope and request previews
The read-only search and record routes use the registry's bindPath, just like the tools. Search accepts operations needing no path arguments; detail supplies only a positive numeric id. A sub-resource needing parent_id or an entity addressed by name returns HTTP 400 before credentials are resolved or a request is sent. A missing credential returns HTTP 428 with a reason code. The browser catalog offers only top-level listable entities. Use the tools with parent_id for supported sub-resources, or RaynetRequest for named paths. The registry remains the authority for path casing and trailing slashes.
The page draws the search answer as host list cards (CardGrid layout="list", one CardGridItem per record) paged by the host Pager over the server's offset and total. CARD_FIELDS in web-src/RaynetWorkspace.tsx names, per record type, which projected fields make the card's name and status tag; it mirrors SUMMARY_FIELDS in lib/registry.mjs, so change both together. The owner sits on the right and the remaining fields form the description. The order is a filter-surface SelectMenu built from the answer's sortable columns and is kept across pages and searches; changing the record type resets it to the server's newest-first default.
The CRM client owns GET query normalization. Every GET through client.request, including /security/info, defaults to dateFormat=ISO8601; dry-run URLs use the same normalizeQuery helper. An explicit dateFormat is preserved, including an empty string. Null and undefined query values remain absent from the URL. PUT, POST and DELETE receive no date-format default. For example, the page's status route calls request with method: 'GET' and no query. The existing shared HTTP transport still owns query serialization, authentication headers, the timeout and cancellation. The Raynet client owns the retry, which covers only a GET after a concurrency 429.
All five dry_run tool previews apply these defaults without sending a request. Raw writes and their previews still require raw requests to be enabled, full access mode and confirm: true.
Meeting automation control
The plugin publishes raynetMeetings through the existing plugin control seam. It is the seam for a plugin that automates meetings and needs CRM reads and one meeting write of its tags and description, without holding its own Raynet client or credentials.
Minimal use, in a consumer plugin:
const raynet = ctx.control('raynetMeetings');
if (!raynet) return reportUnavailable();
const meetings = await raynet.list({ from: '2026-10-09', to: '2026-10-10' });
A consumer such as meeting-confirm declares consumesControls and requiresControls: ["raynetMeetings"], grants capabilities.reads: ["controls"], and resolves ctx.control('raynetMeetings') at call time. If Raynet is disabled or unavailable the control is absent; the consumer must report unavailable rather than treating this as an empty CRM.
| Method | Contract |
|---|---|
list({ from, to, signal? }) |
ISO dates or ISO date-times; returns an array of raw meeting records with scheduledFrom >= from and scheduledFrom < to, across all pages. |
get(id) |
Positive numeric meeting id; returns the raw meeting record. |
person(id) |
Positive numeric contact-person id; returns the raw person record. |
businessCase(id) |
Positive numeric business case (deal) id, as in a meeting's businessCase.id; returns the raw business case record, whose description holds the deal note. |
update(id, { tags, description }) |
Both fields are strings. POSTs exactly these two fields to the existing meeting update operation; resolves without a value. |
All methods reuse the tools' prepare and send: credentials and access mode are resolved on each call, unattended calls use the configured company login, and update requires read_write or full. The existing HTTP timeout, concurrency limit, read retry and error mapping also apply. Errors reject, including malformed API envelopes. Reads request dateFormat=ISO8601; the existing date-filter normalizer supplies Raynet's accepted wire spelling. List requests use the existing page size and stable id ordering. Each page costs one API request; records are returned without display projection. The consumer filters trigger tags and decides which statuses are eligible.
Real consumer: meeting-confirm, in the plugin registry, which lists meetings over its 30-day discovery window and reads each deal note through this control.
Field evidence and release verification
The committed generated registry describes request fields and filters, not response schemas. The existing request fixtures and schema establish the following names, but do not prove every nested response shape:
| Entity | Canonical names supported by the repository |
|---|---|
| Meeting | id, title, scheduledFrom, scheduledTill, status, completed, description, tags, owner, person. The date-filter fixture is in tests/meetings.test.mjs of this plugin; the remaining request fields are in lib/registry.generated.mjs. |
| Person | id, firstName, lastName, contactInfo. The registry lists contactInfo.email and contactInfo.email2 as filter names and contactInfo as an object. |
There is no captured meeting/person response fixture proving owner email or telephone field names. In particular, owner.email, scalar versus object owner/person references, phone keys inside contactInfo, mobile preference, status values, and read-side tag shape remain unverified consumer assumptions. Do not add guessed alternate fields. The raw control intentionally does not normalize them; the meeting-confirm consumer must document and validate its one chosen schema.
The generated update schema declares tags: string, whereas create declares tags: string[]. This control accepts the update type and does not join arrays or guess a delimiter. A comma-separated tag string is an unverified write-format assumption. Verify owner routing, phone fields, status and tag response shape, and a tag/description write against tagged pilot records before release. All implementation checks use mocked APIs; no live field verification was performed.
Registry generation
lib/registry.generated.mjs is generated from Raynet's OpenAPI document by tools/generate-registry.mjs, run by hand when Raynet publishes a new API version. The generated file is the only authority on methods and paths. Do not edit it by hand.
Owning code
index.mjs: the settings normaliser, the tools, theraynetMeetingscontrol and the skill registration.lib/client.mjs: the HTTP client, credential resolution, error mapping and the rate-limit note.lib/routes.mjs: the browser routes under/plugins/raynet/api/.lib/registry.mjsandlib/registry.generated.mjs: the operation table, the access authority of each operation, and path binding.lib/params.mjsandlib/format.mjs: argument checks and the text the tools return.web-src/: the browser page (RaynetWorkspace.tsx,ConnectPanel.tsx,runtime.ts).skills/raynet-crm/SKILL.md: the playbook the assistant loads before working in Raynet.elowen-plugin.jsonandi18n/: the manifest, the labels, and the Czech and Slovak overrides.tests/meetings.test.mjsandtests/p63-get-query.test.mjsin the plugin.
When the plugin is disabled or not granted to a person, its tools, its page and its control are absent. A scheduled job or webhook that acts for nobody has no personal login and uses the company account only.
Preview, catalog and credential boundaries
dry_run previews skip confirmation only. Access mode, operation, path, data and current credentials remain validated; no preview contacts Raynet or changes CRM data. Actual deletes/irreversible actions require explicit consent and confirm true. Raw writes also need the enabled escape hatch and Full access.
RaynetDescribe topic fields lists separate create, update and createWithItems schemas with required markers. Named-create metadata survives alias resolution; businessCase, offer and salesOrder consume it. An absent body schema is stated rather than invented.
credentialsFor(ctx, settings) is the single adapter to resolveCredentials for tools, raw requests and page routes. It awaits userConfig at call time; tools, raw requests, page routes and dry-run previews await the result. It rejects incomplete explicit personal credentials instead of borrowing company credentials and returns source/refusal code. Tools map codes to model text; page routes retain HTTP/translated codes. RaynetSearch and GET search consume it, including credential-checked previews.
node plugins/raynet/tools/generate-registry.mjs [captured-spec.json] deliberately regenerates from official ReDoc or captured JSON, never at startup/CI. Malformed filter identifiers fail before writing; real actions remain while generic activity lock/unlock and system paths are omitted. Captured-spec tests pin serialized entity/generic parity. It performs no CRM writes.
Registration uses ctx.registerSkillDirectory(dir): core owns native PI loading, plugin source identity and pinned catalog metadata, returning the loaded count. Zero is an empty contribution for Raynet and Parts; Brainstorming refuses zero because its feature requires the skill. Account grants/visibility remain host-owned.