@opencxh/domain 1.252.0 → 1.254.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.
@@ -30,7 +30,7 @@ import { OwnerScope } from '../scope/types';
30
30
  * Anyone who *does* want something written during a call uses a playbook on an `activity` trigger.
31
31
  * That one has a run, an owner and an approval gate.
32
32
  */
33
- export type ReadStep = LookupStep | ConditionStep | ForEachStep<ReadStep> | ParallelStep<ReadStep>;
33
+ export type ReadStep = LookupStep | ConditionStep<ReadStep> | ForEachStep<ReadStep> | ParallelStep<ReadStep>;
34
34
  /** The step types a read lane may hold — the runtime counterpart of {@link ReadStep}. */
35
35
  export declare const READ_STEP_TYPES: readonly string[];
36
36
  export interface LiveLens {
@@ -7,3 +7,21 @@
7
7
  * `voorstel: tool:mcp__jira__create_issue`.
8
8
  */
9
9
  export declare function humanizeAction(action: string): string;
10
+ /** The namespaced tool id without the step's `tool:` prefix. */
11
+ export declare function toolName(action: string): string;
12
+ /**
13
+ * The tool's own name, without the namespace that says who owns it:
14
+ * `work__create_work_item` and `mcp__jira__create_issue` become `create_work_item` and
15
+ * `create_issue`. The owner is shown separately (a group header, a chip), so repeating it
16
+ * in every row only costs width.
17
+ */
18
+ export declare function toolBareName(action: string): string;
19
+ /**
20
+ * What a person reads in a picker: `work__create_work_item` becomes `Create work item`.
21
+ *
22
+ * Derived and not translated, on purpose. A tool declares a `description` written for the
23
+ * model and no label of its own, so the honest options were this or a `title` field in
24
+ * thirteen apps — work that has not earned itself yet. The raw id stays visible next to it,
25
+ * because that is what an error message and the run trace will say.
26
+ */
27
+ export declare function toolDisplayName(action: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -59,12 +59,28 @@ export declare const STEP_MAX_TOKENS_MAX = 8000;
59
59
  * a string in `max_tokens` is a 400 at OpenAI and Anthropic.
60
60
  */
61
61
  export declare function clampStepMaxTokens(value: unknown): number | undefined;
62
- export interface ConditionStep {
62
+ /**
63
+ * Generic over the step body for the same reason as {@link ForEachStep}: a restricted step
64
+ * language must stay a real subtype. Without the parameter a read lane could carry a write
65
+ * step inside `else` — see `ReadStep` in `../live-lens/types`.
66
+ */
67
+ export interface ConditionStep<S = Step> {
63
68
  type: "condition";
64
69
  /** JSONLogic expression evaluated against the run vars. */
65
70
  if: unknown;
66
71
  /** Gate: what to do when the condition is false. "then" = the steps that follow. */
67
72
  onFalse: "stop" | "escalate" | "continue";
73
+ /**
74
+ * The false branch. Runs **before** `onFalse` is applied, so the two fields answer different
75
+ * questions: `else` is *what happens*, `onFalse` is *how the branch ends* — `stop` (a branch
76
+ * of its own, the default the editor writes), `escalate` (hand off after doing this) or
77
+ * `continue` (both branches rejoin on the step after the condition).
78
+ *
79
+ * Absent or empty ⇒ exactly the behaviour every existing playbook has today; this field adds
80
+ * a branch, it does not redefine one. A branch step that does not continue (stop, a held
81
+ * action, a wait) decides the outcome itself and `onFalse` no longer applies.
82
+ */
83
+ else?: S[];
68
84
  }
69
85
  /**
70
86
  * Generic over the step body so a restricted step language can be a **real subtype** instead
@@ -1,10 +1,10 @@
1
1
  import { SlaClock, SlaMetric, SlaProfile } from './types';
2
2
  /**
3
- * The nine facts a source app reports about a resource. It reports *what happened*; every
3
+ * The facts a source app reports about a resource. It reports *what happened*; every
4
4
  * decision about which clock starts, stops or pauses lives here, so a second source app
5
5
  * (work items, later) needs an adapter and nothing else.
6
6
  */
7
- export type SlaEventKind = "apply" | "answered" | "inbound" | "outbound" | "resolved" | "closed" | "reopened" | "snoozed" | "unsnoozed" | "discarded";
7
+ export type SlaEventKind = "apply" | "answered" | "inbound" | "outbound" | "resolved" | "closed" | "reopened" | "snoozed" | "unsnoozed" | "hold" | "unhold" | "discarded";
8
8
  /**
9
9
  * The facts a source app may report. `apply` is excluded on purpose: attaching a profile is a
10
10
  * user-facing decision with its own route and its own authorization, not something an app
@@ -18,6 +18,14 @@ export type SlaClockState = "running" | "paused" | "hit" | "missed" | "void";
18
18
  /** Bit values for {@link SlaClock.pauseBits}. */
19
19
  export declare const PAUSE_SNOOZED = 1;
20
20
  export declare const PAUSE_WAITING_FOR_CUSTOMER = 2;
21
+ /**
22
+ * Somebody decided this one is on hold. Deliberately not an {@link SlaPauseReason}: the other
23
+ * two are profile settings, this one is a person overruling the profile per conversation.
24
+ *
25
+ * It exists because `waiting_for_customer` resumes on *any* inbound message, and "thanks!" or
26
+ * an out-of-office is not the customer handing the work back.
27
+ */
28
+ export declare const PAUSE_HOLD = 4;
21
29
  export declare function pauseBitFor(reason: SlaPauseReason): number;
22
30
  /**
23
31
  * Opening hours as the clock needs them: minutes from local midnight, plus the offset to
@@ -4,6 +4,8 @@ import { SlaClock } from './types';
4
4
  * server, in the browser and on mobile.
5
5
  */
6
6
  export declare function isOpenClock(clock: SlaClock): boolean;
7
+ /** Held by hand, rather than by a profile rule. Keeps the bit out of the components. */
8
+ export declare function isHeldClock(clock: SlaClock): boolean;
7
9
  /**
8
10
  * Working ms left. Negative once the deadline has passed.
9
11
  *