@ggui-ai/negotiator 0.8.0 → 0.9.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.
|
@@ -337,7 +337,7 @@ export const BENCH_CORPUS = [
|
|
|
337
337
|
'create',
|
|
338
338
|
'remove',
|
|
339
339
|
],
|
|
340
|
-
notes: 'agent-backed/persisted = the agent OWNS the items → todos seed on propsSpec (refreshed via
|
|
340
|
+
notes: 'agent-backed/persisted = the agent OWNS the items → todos seed on propsSpec (refreshed via ggui_amend); add/delete/toggle are discrete events on actionSpec. contextSpec has no agent-push channel, so an agent-owned persisted list there cannot round-trip — this is the round-trip-correct shape, aligned with list-message-thread / list-file-browser (both props-bearing agent-supplied collections).',
|
|
341
341
|
},
|
|
342
342
|
},
|
|
343
343
|
{
|
|
@@ -77,7 +77,7 @@ A contract has FOUR specs that describe distinct directions on the wire between
|
|
|
77
77
|
THE FOUR-SPEC MODEL
|
|
78
78
|
|
|
79
79
|
propsSpec (agent → UI, render-time + agent-pushed refreshes)
|
|
80
|
-
Data the AGENT owns and supplies — the initial values at mount, AND every later refresh via ggui_update. NOT "static / never changes": propsSpec is the ONLY channel for agent-owned data, mutable or not. A weather card's city+temp (fixed) AND the items of the todo list the agent fetched and keeps in sync (mutable) BOTH live here — the agent seeds them at render and pushes each change with
|
|
80
|
+
Data the AGENT owns and supplies — the initial values at mount, AND every later refresh via ggui_amend (in-place repaint of the mounted card; ggui_update instead mints a NEW history card for milestones). NOT "static / never changes": propsSpec is the ONLY channel for agent-owned data, mutable or not. A weather card's city+temp (fixed) AND the items of the todo list the agent fetched and keeps in sync (mutable) BOTH live here — the agent seeds them at render and pushes each change with ggui_amend. Use whenever the agent is the SOURCE of what the UI shows: the intent names data the agent provides / fetches / owns ("my todos", "the cart", "this user's profile", "the directory contents") OR data the component cannot render without (city, temp). Omit only when the UI originates its own state with no agent-supplied contents (a counter starting at zero, a blank notepad, a list the USER builds locally).
|
|
81
81
|
|
|
82
82
|
streamSpec (agent → UI, live, append-only)
|
|
83
83
|
Channels where the agent pushes live data the UI displays as it arrives. Use ONLY when the intent describes ongoing agent-originated updates (a chat with messages, a live dashboard, a clock, a stock ticker, a notifications feed). Wrong instinct: do NOT use streamSpec for user-driven state, nor for a multi-step wizard / tutorial — its steps are a local stepper plus component-authored copy, not an agent-pushed feed.
|
|
@@ -152,7 +152,7 @@ CONCRETE PATTERNS
|
|
|
152
152
|
Todo list / collection — split on OWNERSHIP, not on mutability. Both kinds mutate; what differs is WHO supplies the items.
|
|
153
153
|
|
|
154
154
|
(a) Agent-owned — "show my todos", "an agent-backed todo list that persists across sessions", "render my cart", "the messages in this thread", "the directory contents"
|
|
155
|
-
The AGENT owns the items: it fetched / persists / keeps them in sync. The collection is the agent's data → it goes on PROPSSPEC, seeded at render and refreshed via
|
|
155
|
+
The AGENT owns the items: it fetched / persists / keeps them in sync. The collection is the agent's data → it goes on PROPSSPEC, seeded at render and refreshed via ggui_amend after each change. This is the ONLY shape that round-trips — contextSpec has no agent-push channel, so an agent-owned list placed there can never be seeded or updated (the UI renders empty). add / delete / toggle are discrete events the agent must witness to persist → declare them on actionSpec (with a matching agentCapabilities tool for each nextStep). Mutability is fine: ggui_amend is exactly how the agent pushes the change.
|
|
156
156
|
propsSpec: { properties: { todos: {schema: {type: "array", items: {type: "object", properties: {id: {type: "string"}, text: {type: "string"}, done: {type: "boolean"}}, required: ["id", "text", "done"]}}, required: true} } }
|
|
157
157
|
actionSpec: { toggleTodo: {label: "Toggle todo", schema: {type: "object", properties: {id: {type: "string"}}, required: ["id"]}, nextStep: "todo_toggle"}, addTodo: {label: "Add todo", schema: {type: "object", properties: {text: {type: "string"}}, required: ["text"]}, nextStep: "todo_add"} }
|
|
158
158
|
|
|
@@ -409,7 +409,7 @@ export const SYNTHESIZE_TOOL = {
|
|
|
409
409
|
description: 'Per-prop map: name → {schema, required?}. Declares the initial render data the agent passes at push time.',
|
|
410
410
|
},
|
|
411
411
|
},
|
|
412
|
-
description: 'Agent-OWNED data the UI displays — the initial values seeded at render, refreshed any time after via
|
|
412
|
+
description: 'Agent-OWNED data the UI displays — the initial values seeded at render, refreshed any time after via ggui_amend. NOT static-only: mutable collections the agent owns / fetched / keeps in sync (my todos, the cart, this thread\'s messages, a directory listing) go here too — propsSpec is the ONLY agent→client data channel. Use whenever the agent is the SOURCE of the displayed data (weather card → city/temp; profile → name/avatar; "my todos" → todos). Omit only when the UI originates its own state with no agent-supplied contents (a counter, a blank notepad, a list the user builds locally).',
|
|
413
413
|
},
|
|
414
414
|
reason: {
|
|
415
415
|
type: 'string',
|
|
@@ -477,7 +477,7 @@ function buildPreservationRepairNote(rejected, dropped) {
|
|
|
477
477
|
'',
|
|
478
478
|
`The agent's draft declared these on propsSpec (agent-owned seed data the UI renders): ${dropped.join(', ')}. Your contract no longer carries them as propsSpec properties — so the agent can no longer seed them at render. contextSpec has NO agent seed channel, so moving them there leaves the UI empty.`,
|
|
479
479
|
'',
|
|
480
|
-
`Re-emit the contract with ${dropped.join(', ')} restored as propsSpec properties (agent-owned, seeded at render and refreshed via
|
|
480
|
+
`Re-emit the contract with ${dropped.join(', ')} restored as propsSpec properties (agent-owned, seeded at render and refreshed via ggui_amend). Keep every other spec unchanged.`,
|
|
481
481
|
].join('\n');
|
|
482
482
|
}
|
|
483
483
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/negotiator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Contract-synthesis + match-judge engine for ggui's handshake. Synthesizes or repairs a conforming DataContract from an agent's draft, judges blueprint-match candidates for reuse, and validates contract structure + novelty — the primitives composed by decideHandshake in @ggui-ai/mcp-server-handlers. Deployment-agnostic: concrete embedding and vector-store bindings plug in via the storage interfaces from @ggui-ai/mcp-server-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@ggui-ai/mcp-server-core": "0.
|
|
51
|
-
"@ggui-ai/protocol": "0.
|
|
50
|
+
"@ggui-ai/mcp-server-core": "0.9.0",
|
|
51
|
+
"@ggui-ai/protocol": "0.9.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^24.0.0",
|
|
@@ -451,7 +451,7 @@ export const BENCH_CORPUS: readonly BenchEntry[] = [
|
|
|
451
451
|
'remove',
|
|
452
452
|
],
|
|
453
453
|
notes:
|
|
454
|
-
'agent-backed/persisted = the agent OWNS the items → todos seed on propsSpec (refreshed via
|
|
454
|
+
'agent-backed/persisted = the agent OWNS the items → todos seed on propsSpec (refreshed via ggui_amend); add/delete/toggle are discrete events on actionSpec. contextSpec has no agent-push channel, so an agent-owned persisted list there cannot round-trip — this is the round-trip-correct shape, aligned with list-message-thread / list-file-browser (both props-bearing agent-supplied collections).',
|
|
455
455
|
},
|
|
456
456
|
},
|
|
457
457
|
{
|
|
@@ -123,7 +123,7 @@ A contract has FOUR specs that describe distinct directions on the wire between
|
|
|
123
123
|
THE FOUR-SPEC MODEL
|
|
124
124
|
|
|
125
125
|
propsSpec (agent → UI, render-time + agent-pushed refreshes)
|
|
126
|
-
Data the AGENT owns and supplies — the initial values at mount, AND every later refresh via ggui_update. NOT "static / never changes": propsSpec is the ONLY channel for agent-owned data, mutable or not. A weather card's city+temp (fixed) AND the items of the todo list the agent fetched and keeps in sync (mutable) BOTH live here — the agent seeds them at render and pushes each change with
|
|
126
|
+
Data the AGENT owns and supplies — the initial values at mount, AND every later refresh via ggui_amend (in-place repaint of the mounted card; ggui_update instead mints a NEW history card for milestones). NOT "static / never changes": propsSpec is the ONLY channel for agent-owned data, mutable or not. A weather card's city+temp (fixed) AND the items of the todo list the agent fetched and keeps in sync (mutable) BOTH live here — the agent seeds them at render and pushes each change with ggui_amend. Use whenever the agent is the SOURCE of what the UI shows: the intent names data the agent provides / fetches / owns ("my todos", "the cart", "this user's profile", "the directory contents") OR data the component cannot render without (city, temp). Omit only when the UI originates its own state with no agent-supplied contents (a counter starting at zero, a blank notepad, a list the USER builds locally).
|
|
127
127
|
|
|
128
128
|
streamSpec (agent → UI, live, append-only)
|
|
129
129
|
Channels where the agent pushes live data the UI displays as it arrives. Use ONLY when the intent describes ongoing agent-originated updates (a chat with messages, a live dashboard, a clock, a stock ticker, a notifications feed). Wrong instinct: do NOT use streamSpec for user-driven state, nor for a multi-step wizard / tutorial — its steps are a local stepper plus component-authored copy, not an agent-pushed feed.
|
|
@@ -198,7 +198,7 @@ CONCRETE PATTERNS
|
|
|
198
198
|
Todo list / collection — split on OWNERSHIP, not on mutability. Both kinds mutate; what differs is WHO supplies the items.
|
|
199
199
|
|
|
200
200
|
(a) Agent-owned — "show my todos", "an agent-backed todo list that persists across sessions", "render my cart", "the messages in this thread", "the directory contents"
|
|
201
|
-
The AGENT owns the items: it fetched / persists / keeps them in sync. The collection is the agent's data → it goes on PROPSSPEC, seeded at render and refreshed via
|
|
201
|
+
The AGENT owns the items: it fetched / persists / keeps them in sync. The collection is the agent's data → it goes on PROPSSPEC, seeded at render and refreshed via ggui_amend after each change. This is the ONLY shape that round-trips — contextSpec has no agent-push channel, so an agent-owned list placed there can never be seeded or updated (the UI renders empty). add / delete / toggle are discrete events the agent must witness to persist → declare them on actionSpec (with a matching agentCapabilities tool for each nextStep). Mutability is fine: ggui_amend is exactly how the agent pushes the change.
|
|
202
202
|
propsSpec: { properties: { todos: {schema: {type: "array", items: {type: "object", properties: {id: {type: "string"}, text: {type: "string"}, done: {type: "boolean"}}, required: ["id", "text", "done"]}}, required: true} } }
|
|
203
203
|
actionSpec: { toggleTodo: {label: "Toggle todo", schema: {type: "object", properties: {id: {type: "string"}}, required: ["id"]}, nextStep: "todo_toggle"}, addTodo: {label: "Add todo", schema: {type: "object", properties: {text: {type: "string"}}, required: ["text"]}, nextStep: "todo_add"} }
|
|
204
204
|
|
|
@@ -472,7 +472,7 @@ export const SYNTHESIZE_TOOL: ToolSchema = {
|
|
|
472
472
|
},
|
|
473
473
|
},
|
|
474
474
|
description:
|
|
475
|
-
'Agent-OWNED data the UI displays — the initial values seeded at render, refreshed any time after via
|
|
475
|
+
'Agent-OWNED data the UI displays — the initial values seeded at render, refreshed any time after via ggui_amend. NOT static-only: mutable collections the agent owns / fetched / keeps in sync (my todos, the cart, this thread\'s messages, a directory listing) go here too — propsSpec is the ONLY agent→client data channel. Use whenever the agent is the SOURCE of the displayed data (weather card → city/temp; profile → name/avatar; "my todos" → todos). Omit only when the UI originates its own state with no agent-supplied contents (a counter, a blank notepad, a list the user builds locally).',
|
|
476
476
|
},
|
|
477
477
|
reason: {
|
|
478
478
|
type: 'string',
|
|
@@ -586,7 +586,7 @@ function buildPreservationRepairNote(
|
|
|
586
586
|
'',
|
|
587
587
|
`The agent's draft declared these on propsSpec (agent-owned seed data the UI renders): ${dropped.join(', ')}. Your contract no longer carries them as propsSpec properties — so the agent can no longer seed them at render. contextSpec has NO agent seed channel, so moving them there leaves the UI empty.`,
|
|
588
588
|
'',
|
|
589
|
-
`Re-emit the contract with ${dropped.join(', ')} restored as propsSpec properties (agent-owned, seeded at render and refreshed via
|
|
589
|
+
`Re-emit the contract with ${dropped.join(', ')} restored as propsSpec properties (agent-owned, seeded at render and refreshed via ggui_amend). Keep every other spec unchanged.`,
|
|
590
590
|
].join('\n');
|
|
591
591
|
}
|
|
592
592
|
|