@amalgm/chat 0.2.9-main.34938475453 → 0.2.9-main.34940892196

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.
package/PURPOSE.md CHANGED
@@ -212,6 +212,8 @@ automations, and third-party apps must all use the same public SDK.
212
212
  idempotency key and retried until acknowledged. Platform usage is metered and
213
213
  persisted by the API proxy for each upstream invocation; local observations
214
214
  cannot create a second charge. The authenticated host supplies ownership.
215
+ Delivery starts only with a complete host-supplied platform capability;
216
+ absent delivery configuration leaves measurements pending and local Chat usable.
215
217
  49. Only commands with an explicit Amalgm normalization may be advertised or
216
218
  executed. Native discovery is evidence, never execution permission. The only
217
219
  enabled command is `/compact`, on adapters with a proven compaction mapping;
package/host/index.js CHANGED
@@ -31,9 +31,10 @@ export async function createChatHost(options) {
31
31
  : options.journalBatch || createSqliteJournalBatchPolicy(),
32
32
  });
33
33
  const recoveredTurns = await chat.recoverInterruptedTurns();
34
- const usageDelivery = options.native?.credentialBroker && typeof conversations.pendingUsage === 'function'
34
+ const proxy = runtime.preparer?.platformProxy({ required: false });
35
+ const usageDelivery = proxy && typeof conversations.pendingUsage === 'function'
35
36
  ? createUsageDelivery({ store: conversations, ownerUserId: options.ownerUserId,
36
- proxy: runtime.preparer.platformProxy() }) : null;
37
+ proxy }) : null;
37
38
  const handleHttp = createChatHttpHandler({
38
39
  chat,
39
40
  ...(typeof runtime.forwardEgress === 'function'
@@ -188,8 +188,9 @@ export class NativeExecutionPreparer {
188
188
  });
189
189
  }
190
190
 
191
- platformProxy() {
191
+ platformProxy({ required = true } = {}) {
192
192
  if (!this.proxyBaseUrl || !this.credentialBroker) {
193
+ if (!required) return null;
193
194
  throw new InvalidPreparedAuthError('Platform proxy is not configured');
194
195
  }
195
196
  return Object.freeze({ baseUrl: this.proxyBaseUrl, credentialBroker: this.credentialBroker });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amalgm/chat",
3
- "version": "0.2.9-main.34938475453",
3
+ "version": "0.2.9-main.34940892196",
4
4
  "description": "A provider-agnostic agent chat SDK with ACP content, prepared execution, normalized streams, and usage.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -118,11 +118,11 @@
118
118
  "allowScripts": {
119
119
  "better-sqlite3@12.11.1": true
120
120
  },
121
- "gitHead": "bf1d5f80f0f5aa121d52ec50bd190e45b79bb643",
121
+ "gitHead": "3c61d7870f91e95a530cacf4d7f175bebe1cf13a",
122
122
  "amalgmSource": {
123
123
  "repository": "amalgm-inc/amalgm-chat",
124
124
  "branch": "main",
125
- "commit": "bf1d5f80f0f5aa121d52ec50bd190e45b79bb643",
126
- "occurrence": "34938475453"
125
+ "commit": "3c61d7870f91e95a530cacf4d7f175bebe1cf13a",
126
+ "occurrence": "34940892196"
127
127
  }
128
128
  }