@qontinui/shared-types 0.11.0 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qontinui/shared-types",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Shared TypeScript types for the Qontinui ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,81 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with `just generate-types` or
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * An account-scoped **override** of a runner-embedded default agent command.
10
+ *
11
+ * Presence of this record means "this organization has customized the command
12
+ * named `name`"; absence means the embedded default applies. See the module
13
+ * docs for the full resolution order and the delete-is-reset semantics.
14
+ *
15
+ * `body` is the whole markdown procedure — the exact bytes written to
16
+ * `.claude/commands/<name>.md`. It is **untrusted remote content** from the
17
+ * runner's point of view: it is markdown rather than code, but it is
18
+ * instructions to an agent, so consumers fail soft (a malformed override falls
19
+ * back to the embedded default and warns) and never fetch cross-org.
20
+ */
21
+ export interface AgentCommand {
22
+ /**
23
+ * The full markdown body of the command.
24
+ */
25
+ body: string;
26
+ /**
27
+ * Content hash of [`body`](Self::body), for cheap change detection
28
+ * (cache invalidation, diff-against-default). `None` on rows written
29
+ * before a checksum was computed.
30
+ *
31
+ * Computed by [`agent_command_checksum`] — `"sha256-<hex>"` over the
32
+ * LF-normalized body. Do not hand-roll it; a producer that hashes raw
33
+ * bytes disagrees with one that hashes a CRLF round-trip.
34
+ */
35
+ checksum?: string | null;
36
+ /**
37
+ * ISO 8601 (RFC 3339) creation timestamp.
38
+ */
39
+ created_at: string;
40
+ /**
41
+ * User who last authored this override. **Attribution only** — it does not
42
+ * scope visibility; [`organization_id`](Self::organization_id) does.
43
+ */
44
+ created_by_user_id?: string | null;
45
+ /**
46
+ * Head of the version chain — the `version_number` of the
47
+ * [`AgentCommandVersion`] whose body this record currently carries.
48
+ * Starts at 1 and only ever increases (a revert bumps it; see the module
49
+ * docs).
50
+ */
51
+ current_version: number;
52
+ /**
53
+ * Override record id (UUID v4 string).
54
+ */
55
+ id: string;
56
+ /**
57
+ * Whether this override is visible to the whole organization rather than
58
+ * only its author. Absent means `false`.
59
+ */
60
+ is_shared: boolean;
61
+ /**
62
+ * The command slug, e.g. `vet-plan` or `implement-plan`. This is the
63
+ * override key: it must equal the name of the embedded default it
64
+ * replaces, and it is the filename stem under `.claude/commands/`.
65
+ *
66
+ * Because it becomes a path component, it is a write-boundary value —
67
+ * validate it with [`validate_agent_command_name`] before persisting.
68
+ */
69
+ name: string;
70
+ /**
71
+ * Owning organization (`auth.organizations.id`). `None` where the row has
72
+ * been orphaned by an organization deletion (`ondelete SET NULL`); such a
73
+ * row is not resolvable by any account and behaves as no override.
74
+ */
75
+ organization_id?: string | null;
76
+ /**
77
+ * ISO 8601 (RFC 3339) last-modification timestamp.
78
+ */
79
+ updated_at: string;
80
+ [k: string]: unknown;
81
+ }
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with `just generate-types` or
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * Failure modes for agent-command overrides. Mirrors the tagged-enum shape of
10
+ * [`crate::apps::AppError`], so the qontinui-web layer can surface a rejected
11
+ * override the same way it surfaces a rejected app registration.
12
+ */
13
+ export type AgentCommandError =
14
+ | {
15
+ name: string;
16
+ reason: "invalid-name";
17
+ [k: string]: unknown;
18
+ }
19
+ | {
20
+ name: string;
21
+ reason: "reserved-name";
22
+ [k: string]: unknown;
23
+ };
@@ -0,0 +1,67 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated.
4
+ * DO NOT MODIFY IT BY HAND. Regenerate with `just generate-types` or
5
+ * `qontinui-runner/src-tauri/scripts/generate_types.sh`.
6
+ */
7
+
8
+ /**
9
+ * One immutable entry in an [`AgentCommand`]'s append-only version chain.
10
+ *
11
+ * Rows are **only ever inserted**. An edit appends the next `version_number`;
12
+ * a revert appends a new version whose `body` is copied from an older one and
13
+ * whose [`restored_from`](Self::restored_from) names that older version.
14
+ * Nothing in the chain is updated or deleted, so the chain is the complete
15
+ * edit history and "revert" is itself a recorded edit.
16
+ */
17
+ export interface AgentCommandVersion {
18
+ /**
19
+ * The [`AgentCommand`] this version belongs to. Deleting the override
20
+ * cascades to its versions — resetting to the default discards the
21
+ * account's edit history along with the override.
22
+ */
23
+ agent_command_id: string;
24
+ /**
25
+ * The full markdown body as of this version.
26
+ */
27
+ body: string;
28
+ /**
29
+ * Free-text note describing what changed, supplied by the editor. Revert
30
+ * writes a generated one (e.g. `"Restored from version 2"`).
31
+ */
32
+ change_description?: string | null;
33
+ /**
34
+ * Content hash of [`body`](Self::body) at this version, from
35
+ * [`agent_command_checksum`]. Equal checksums on two versions mean the
36
+ * bodies are identical — which is what lets the UI show a revert as
37
+ * "back to v2's content" without refetching either body.
38
+ */
39
+ checksum?: string | null;
40
+ /**
41
+ * ISO 8601 (RFC 3339) creation timestamp. Versions are immutable, so
42
+ * there is deliberately no `updated_at`.
43
+ */
44
+ created_at: string;
45
+ /**
46
+ * User who authored this version. Attribution only.
47
+ */
48
+ created_by_user_id?: string | null;
49
+ /**
50
+ * Version-row id (UUID v4 string).
51
+ */
52
+ id: string;
53
+ /**
54
+ * Provenance for a revert: the `version_number` this version's body was
55
+ * copied from. `None` for an ordinary edit. Present only on versions
56
+ * produced by a restore, which is how the UI distinguishes "edited" from
57
+ * "reverted to v2" in the history list.
58
+ */
59
+ restored_from?: number | null;
60
+ /**
61
+ * Monotonic version number within this command, starting at 1. Unique per
62
+ * `(agent_command_id, version_number)`; the DB constraint — not
63
+ * application code — is what rejects a duplicate under concurrent appends.
64
+ */
65
+ version_number: number;
66
+ [k: string]: unknown;
67
+ }
@@ -13,6 +13,19 @@ export interface ComponentActionInfo {
13
13
  * Longer description of what the action does.
14
14
  */
15
15
  description?: string | null;
16
+ /**
17
+ * Safety class of this action: `read`, `write` or `destructive`.
18
+ *
19
+ * **A safety annotation, not a hint.** An autonomous walk MUST NOT fire an
20
+ * action annotated `destructive`; that is the same exclusion the IR already
21
+ * applies to `destructive` transitions when generating auto-regressions.
22
+ * Author-declared, because only the app author knows that a particular
23
+ * `click` is a delete button.
24
+ *
25
+ * Absent means **unclassified, not safe** — an action nobody has judged
26
+ * must be treated as unknown rather than as `read`.
27
+ */
28
+ effect?: ("read" | "write" | "destructive") | null;
16
29
  /**
17
30
  * Unique action identifier within the component.
18
31
  */
@@ -21,4 +34,24 @@ export interface ComponentActionInfo {
21
34
  * Human-readable label.
22
35
  */
23
36
  label?: string | null;
37
+ /**
38
+ * Free-form declaration of the action's parameters, author-supplied on the
39
+ * SDK side as `ComponentAction.paramSchema` and surfaced verbatim on
40
+ * `/control/components`. Conventionally a small JSON Schema subset, but the
41
+ * SDK does not constrain the shape, so it is carried through untyped — the
42
+ * same treatment `ElementActionRequest::params` gets.
43
+ */
44
+ paramSchema?: {
45
+ [k: string]: unknown;
46
+ };
47
+ /**
48
+ * Fully-resolved invocation path for this action:
49
+ * `/control/component/<componentId>/action/<actionId>`.
50
+ *
51
+ * **Server-annotated, not author-declared**: the SDK's
52
+ * `annotateComponentWithInvocationPaths` computes it when serving the
53
+ * component listing, so it is present on the wire but absent from anything
54
+ * an app author writes.
55
+ */
56
+ path?: string | null;
24
57
  }
@@ -14,6 +14,16 @@ import type { ComponentActionInfo } from "./ComponentActionInfo";
14
14
  * (e.g. "submit form", "reset filters").
15
15
  */
16
16
  export interface UIBridgeComponent {
17
+ /**
18
+ * Invocation-path template for this component's actions, emitted with a
19
+ * literal `{actionId}` placeholder:
20
+ * `/control/component/<componentId>/action/{actionId}`.
21
+ *
22
+ * **Server-annotated, not author-declared**: emitted by the SDK's
23
+ * `annotateComponentWithInvocationPaths` alongside the per-action
24
+ * [`ComponentActionInfo::path`].
25
+ */
26
+ actionInvocationPath?: string | null;
17
27
  /**
18
28
  * Actions exposed by this component.
19
29
  */
@@ -18,6 +18,9 @@ export type { ActionResponse } from './ActionResponse';
18
18
  export type { ActionStatus } from './ActionStatus';
19
19
  export type { ActionType } from './ActionType';
20
20
  export type { ActiveStatesResult } from './ActiveStatesResult';
21
+ export type { AgentCommand } from './AgentCommand';
22
+ export type { AgentCommandError } from './AgentCommandError';
23
+ export type { AgentCommandVersion } from './AgentCommandVersion';
21
24
  export type { AgenticPhaseOutput } from './AgenticPhaseOutput';
22
25
  export type { AgenticStatus } from './AgenticStatus';
23
26
  export type { AiWorkflow } from './AiWorkflow';