@ampcode/plugin 0.0.0-20260720025147-ge982146 → 0.0.0-20260722002806-g52a0c4a
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/index.d.ts +25 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -360,6 +360,11 @@ declare module '@ampcode/plugin' {
|
|
|
360
360
|
parentThreadID?: ThreadID
|
|
361
361
|
/** Show the created thread and make it active in the client when supported. */
|
|
362
362
|
show?: boolean
|
|
363
|
+
/**
|
|
364
|
+
* Enable multiplayer for this many seconds. Multiplayer threads must run in an
|
|
365
|
+
* Orb and belong to a workspace. Valid values range from 5 minutes to 7 days.
|
|
366
|
+
*/
|
|
367
|
+
multiplayerTTLSeconds?: number
|
|
363
368
|
/**
|
|
364
369
|
* Where the thread should execute. Defaults to `local`, which uses the current
|
|
365
370
|
* client as the executor. Use `orb` for Amp's cloud sandbox or a runner target
|
|
@@ -1446,10 +1451,16 @@ declare module '@ampcode/plugin' {
|
|
|
1446
1451
|
/** Stable server-owned event ID. Use this to make handler effects idempotent. */
|
|
1447
1452
|
id: string
|
|
1448
1453
|
|
|
1449
|
-
/**
|
|
1454
|
+
/** Exact bytes received in the HTTP request body. */
|
|
1455
|
+
body: Uint8Array
|
|
1456
|
+
|
|
1457
|
+
/** Requested HTTP headers, with lowercase names. */
|
|
1458
|
+
headers: Readonly<Record<string, string>>
|
|
1459
|
+
|
|
1460
|
+
/** @deprecated Use `body` instead. Internal JSON-compatible transport payload. */
|
|
1450
1461
|
payload: unknown
|
|
1451
1462
|
|
|
1452
|
-
/**
|
|
1463
|
+
/** @deprecated Transport metadata retained for compatibility. */
|
|
1453
1464
|
metadata: Readonly<Record<string, string>>
|
|
1454
1465
|
|
|
1455
1466
|
/** ISO 8601 timestamp recorded when the server accepted the webhook. */
|
|
@@ -1470,13 +1481,24 @@ declare module '@ampcode/plugin' {
|
|
|
1470
1481
|
/** Stable, non-whitespace-padded key within this plugin and thread (1-128 characters). */
|
|
1471
1482
|
key: string
|
|
1472
1483
|
|
|
1484
|
+
/**
|
|
1485
|
+
* HTTP headers to preserve. Names are case-insensitive, and delivered names are lowercase.
|
|
1486
|
+
* Defaults to an empty list; no request headers are preserved implicitly.
|
|
1487
|
+
*/
|
|
1488
|
+
headers?: readonly string[]
|
|
1489
|
+
|
|
1473
1490
|
/** At-least-once handler for matching durable webhook events. */
|
|
1474
1491
|
handler: (event: WebhookEvent, ctx: WebhookHandlerContext) => void | Promise<void>
|
|
1475
1492
|
}
|
|
1476
1493
|
|
|
1477
1494
|
/** Safe registration information returned to the plugin. */
|
|
1478
1495
|
export interface WebhookRegistration {
|
|
1479
|
-
/**
|
|
1496
|
+
/**
|
|
1497
|
+
* Capability URL for webhook POST requests. Treat this URL as a credential. Each webhook
|
|
1498
|
+
* accepts a burst of 10 new events and refills at 10 events per minute. A rate-limited
|
|
1499
|
+
* request returns HTTP 429 with a `Retry-After` header; a retry matching an event still
|
|
1500
|
+
* pending delivery by `Idempotency-Key` does not consume rate capacity.
|
|
1501
|
+
*/
|
|
1480
1502
|
url: string
|
|
1481
1503
|
}
|
|
1482
1504
|
|