@ziggs-ai/contracts 0.48.1 → 0.49.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.
@@ -12,7 +12,7 @@ export type GrantCaveatView = {
12
12
  value: unknown;
13
13
  };
14
14
  export type GrantBasis = {
15
- kind: "creation" | "publication" | "membership" | "acceptance" | "agreement" | "vouch" | "owner" | "contact" | "thread";
15
+ kind: "creation" | "publication" | "membership" | "acceptance" | "agreement" | "vouch" | "owner" | "contact" | "answer";
16
16
  id: string | null;
17
17
  };
18
18
  export type GrantView = {
@@ -102,6 +102,7 @@ function parseMessageCommand(value) {
102
102
  'sources',
103
103
  'mandate',
104
104
  'relationships',
105
+ 'page',
105
106
  ], 'message command');
106
107
  const content = object(row.content, ['text'], 'content');
107
108
  const audience = object(row.audience, ['kind', 'principalIds'], 'audience');
@@ -129,6 +130,8 @@ function parseMessageCommand(value) {
129
130
  };
130
131
  if (row.sources !== undefined)
131
132
  command.sources = list(row.sources, source, 'sources', 50);
133
+ if (row.page !== undefined)
134
+ command.page = exactArtifact(row.page);
132
135
  if (row.mandate !== undefined) {
133
136
  const mandate = object(row.mandate, ['agreementId', 'taskId'], 'mandate');
134
137
  command.mandate = {
@@ -74,6 +74,13 @@ export interface MessageCommand {
74
74
  intent: MessageIntent;
75
75
  /** Private provenance: only the sender sees it back, as `sentFrom`. */
76
76
  sources?: MessageSourceRef[];
77
+ /**
78
+ * The page this message carries: an HTML file, by its exact version. A
79
+ * thread whose first message carries a page is shown as that page; a later
80
+ * page from the same sender in the thread is its new version. A page that
81
+ * names no reply target starts its own thread, even in a wake.
82
+ */
83
+ page?: ExactArtifactRef;
77
84
  /** Required when the selected work/spending relies on an agreement. No fallback. */
78
85
  mandate?: {
79
86
  agreementId: string;
@@ -104,6 +111,8 @@ export interface MessageRecord {
104
111
  /** Null unless the viewer may read this mandate; never infer authority from it. */
105
112
  mandate: MessageCommand['mandate'] | null;
106
113
  intent: MessageIntent;
114
+ /** The page it carries; null when it carries none, or the viewer cannot read the file. */
115
+ page: ExactArtifactRef | null;
107
116
  /** The outside channel it arrived through, without its provider reference. */
108
117
  importedFrom: {
109
118
  channel: 'slack' | 'email' | 'github';
@@ -114,6 +123,11 @@ export interface MessageRecord {
114
123
  artifactId: string;
115
124
  name: string;
116
125
  }> | null;
126
+ /** Set when the person who owns the sending agent wrote this message as that
127
+ * agent: the ref of that person among `readers`. The message is the agent's;
128
+ * this says who wrote it, the way `ownerOf` says who reads along. Absent on
129
+ * every message the agent wrote itself. */
130
+ writtenBy?: string;
117
131
  }
118
132
  export interface MessageCommandResult {
119
133
  outcome: 'created' | 'existing';
package/dist/socket.d.ts CHANGED
@@ -27,6 +27,11 @@ export interface ResourceChangedFrame {
27
27
  ts: string;
28
28
  /** Primary id of the resource that changed. */
29
29
  resourceId: string;
30
+ /**
31
+ * For a message: the first message of its thread. It grants nothing; it
32
+ * lets an open thread, or a page shown from it, tell its own replies.
33
+ */
34
+ rootMessageId?: string;
30
35
  addressId?: string;
31
36
  agreementId?: string;
32
37
  taskId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/contracts",
3
- "version": "0.48.1",
3
+ "version": "0.49.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",