@ziggs-ai/contracts 0.43.0 → 0.44.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.
@@ -154,11 +154,11 @@ function parseMessageCommand(value) {
154
154
  }
155
155
  case 'answer':
156
156
  object(effect, ['kind', 'action', 'artifacts'], 'effect');
157
- effectValue = {
158
- kind: 'answer',
159
- action: messageAction(effect.action),
160
- artifacts: list(effect.artifacts, exactArtifact, 'answer artifacts'),
161
- };
157
+ // Published 0.43 clients require this field. Normalize the empty wire
158
+ // value away; actual files use relationships.artifacts on every message.
159
+ if (effect.artifacts !== undefined)
160
+ list(effect.artifacts, exactArtifact, 'answer artifacts', 0);
161
+ effectValue = { kind: 'answer', action: messageAction(effect.action) };
162
162
  break;
163
163
  case 'provide-input': {
164
164
  object(effect, ['kind', 'action'], 'effect');
@@ -65,12 +65,15 @@ export type MessageActionEffect = {
65
65
  } | {
66
66
  kind: 'provide-input';
67
67
  action: import('./actions').ActionSlotRef;
68
- } | {
68
+ }
69
+ /** Files on an answer go in relationships.artifacts, like any message. */
70
+ | {
69
71
  kind: 'answer';
70
72
  action: Extract<import('./actions').ActionSlotRef, {
71
73
  kind: 'message';
72
74
  }>;
73
- artifacts: ExactArtifactRef[];
75
+ /** @deprecated Accepted empty for published 0.43 clients; files belong in relationships. */
76
+ artifacts?: [];
74
77
  };
75
78
  export interface MessageCommand {
76
79
  /** Authenticated accountable principal scopes this identity. Changed input conflicts. */
@@ -83,7 +86,7 @@ export interface MessageCommand {
83
86
  /** Resolve once and persist the snapshot atomically with the message. */
84
87
  deliveries: MessageDeliveries;
85
88
  effect: MessageActionEffect;
86
- /** Private provenance, never included in the message presentation. */
89
+ /** Private provenance: only the sender sees it back, as `sentFrom`. */
87
90
  sources?: MessageSourceRef[];
88
91
  /** Required when the selected work/spending relies on an agreement. No fallback. */
89
92
  mandate?: {
@@ -122,6 +125,12 @@ export interface MessageRecord {
122
125
  importedFrom: {
123
126
  channel: 'slack' | 'email' | 'github';
124
127
  } | null;
128
+ /** Null for every viewer but the sender. For the sender: the pages they sent
129
+ * it from that they can still read. Other readers never learn the source. */
130
+ sentFrom: Array<{
131
+ artifactId: string;
132
+ name: string;
133
+ }> | null;
125
134
  }
126
135
  export interface MessageCommandResult {
127
136
  outcome: 'created' | 'existing';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/contracts",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Wire contracts for the Ziggs API — response shapes, error body, and socket events, shared by every client.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",