@plitzi/sdk-shared 0.35.10 → 0.36.1

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.
@@ -1,5 +1,5 @@
1
1
  import { Environment } from './CommonTypes';
2
- import { InteractionNodeStatus } from './InteractionTypes';
2
+ import { InteractionNode, InteractionNodeStatus } from './InteractionTypes';
3
3
  import { ElementInteraction } from './SchemaTypes';
4
4
  import { SmtpSettings } from '../actions/smtp';
5
5
  /**
@@ -293,8 +293,10 @@ export type ActionRejectRecord = {
293
293
  * Emitted for every run that STARTED — completed, failed or aborted — and never for one refused before it began:
294
294
  * a 409 is not a run, and logging it would bury the real ones under retries.
295
295
  *
296
- * Deliberately not the trace: step results are the space's own data and can be large, so what travels here is the
297
- * shape of what happened. The trace goes to the author who asked for it, in the test-run panel.
296
+ * Two halves with different weight. `steps` is the shape of what happened, safe for any history. `input`, `output`
297
+ * and `trace` are the run's DATA — what it was given, what each step read and answered — redacted of every credential
298
+ * value the run resolved but otherwise the space's own and possibly personal: a deployment that keeps them keeps
299
+ * them apart, behind its strictest access, and a log line never carries them.
298
300
  */
299
301
  export type ActionRunRecord = {
300
302
  runId: string;
@@ -303,15 +305,22 @@ export type ActionRunRecord = {
303
305
  environment: Environment;
304
306
  trigger: ActionTriggerType;
305
307
  status: ActionRunStatus;
308
+ /** When the run started, epoch ms. */
309
+ startedAt: number;
306
310
  durationMs: number;
307
311
  /** Who asked, when a session carried it. Absent for a webhook, a schedule or an anonymous visitor. */
308
312
  userId?: number;
309
- /** One entry per step that ran, in order — enough to see where a flow stopped without keeping its data. */
310
- nodes: {
311
- id: string;
312
- action: string;
313
- status: string;
314
- }[];
313
+ /**
314
+ * Every step that ran, in order, as a debugger may see it — enough to see where a flow stopped, how long each step
315
+ * took and why one failed, without keeping anything a step was given or returned.
316
+ */
317
+ steps: ActionRunStep[];
318
+ /** What the run was started with. Data — see above. */
319
+ input: Record<string, unknown>;
320
+ /** What `flow.output` answered; empty for a run that never got there. Data — see above. */
321
+ output: Record<string, unknown>;
322
+ /** Every step whole, with what it read and answered, in the order it ran. Data — see above. */
323
+ trace: InteractionNode[];
315
324
  /** Present when the run ended badly. Already redacted of credential values. */
316
325
  error?: string;
317
326
  };
@@ -437,7 +446,7 @@ export type ActionCheckReport = {
437
446
  * ended, not what they held.
438
447
  */
439
448
  export type ActionEvent = {
440
- id: number;
449
+ id: string;
441
450
  actionId: string;
442
451
  runId?: string | null;
443
452
  trigger: string;
@@ -19,7 +19,7 @@ export type InteractionNode = {
19
19
  endTime: number;
20
20
  whenParams?: Record<string, RuleValue>;
21
21
  };
22
- export type InteractionParamType = 'boolean' | 'select' | 'text' | 'textarea' | 'codemirror-text' | 'codemirror-json';
22
+ export type InteractionParamType = 'boolean' | 'select' | 'text' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
23
23
  export type InteractionCallbackParamValues<T extends Record<string, unknown> = Record<string, unknown>> = T;
24
24
  export type InteractionCallbackParam<T extends Record<string, unknown> = Record<string, unknown>> = {
25
25
  canBind?: boolean;
@@ -45,6 +45,14 @@ export type InteractionCallbackParam<T extends Record<string, unknown> = Record<
45
45
  } | {
46
46
  type: 'boolean';
47
47
  defaultValue?: boolean;
48
+ } | {
49
+ /**
50
+ * Several elements of the space, stored as their ids. The editor offers the elements of `elementType` to pick
51
+ * from — it is the one that knows the page — so a step never asks for ids typed by hand.
52
+ */
53
+ type: 'elements';
54
+ defaultValue?: string[];
55
+ elementType?: string;
48
56
  } | {
49
57
  type: 'select';
50
58
  defaultValue?: string;
@@ -57,7 +65,7 @@ export type InteractionCallbackParam<T extends Record<string, unknown> = Record<
57
65
  }[]);
58
66
  } | {
59
67
  type: (params: InteractionCallbackParamValues<T>) => InteractionParamType;
60
- defaultValue?: string | number | boolean;
68
+ defaultValue?: string | number | boolean | string[];
61
69
  options?: {
62
70
  label: string;
63
71
  value: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-shared",
3
- "version": "0.35.10",
3
+ "version": "0.36.1",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -956,6 +956,22 @@
956
956
  "types": "./dist/network/spaceEvents.d.ts",
957
957
  "import": "./dist/network/spaceEvents.mjs"
958
958
  },
959
+ "./queries": {
960
+ "types": "./dist/queries/index.d.ts",
961
+ "import": "./dist/queries/index.mjs"
962
+ },
963
+ "./queries/index": {
964
+ "types": "./dist/queries/index.d.ts",
965
+ "import": "./dist/queries/index.mjs"
966
+ },
967
+ "./queries/queryCache": {
968
+ "types": "./dist/queries/queryCache.d.ts",
969
+ "import": "./dist/queries/queryCache.mjs"
970
+ },
971
+ "./queries/useQuery": {
972
+ "types": "./dist/queries/useQuery.d.ts",
973
+ "import": "./dist/queries/useQuery.mjs"
974
+ },
959
975
  "./schema": {
960
976
  "types": "./dist/schema/index.d.ts",
961
977
  "import": "./dist/schema/index.mjs"
@@ -1256,7 +1272,7 @@
1256
1272
  },
1257
1273
  "dependencies": {
1258
1274
  "@modelcontextprotocol/sdk": "^1.30.0",
1259
- "@plitzi/nexus": "^1.1.4",
1275
+ "@plitzi/nexus": "^1.2.0",
1260
1276
  "@plitzi/plitzi-ui": "^1.6.21",
1261
1277
  "date-fns": "^4.4.0",
1262
1278
  "date-fns-tz": "^3.2.0",