@hyperdrive.bot/fleet-client 0.3.179 → 0.3.181

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.
@@ -466,6 +466,12 @@ export type SourceTriggersPayload = Extract<SessionOutboundMessage, {
466
466
  export type SourceSubscribePayload = Extract<SessionOutboundMessage, {
467
467
  type: "source/subscribe/response";
468
468
  }>["payload"];
469
+ export type SourceActionsPayload = Extract<SessionOutboundMessage, {
470
+ type: "source/actions/response";
471
+ }>["payload"];
472
+ export type SourceRunPayload = Extract<SessionOutboundMessage, {
473
+ type: "source/run/response";
474
+ }>["payload"];
469
475
  export type SourceDisconnectPayload = Extract<SessionOutboundMessage, {
470
476
  type: "source/disconnect/response";
471
477
  }>["payload"];
@@ -478,6 +484,9 @@ export type SourceAccountsPayload = Extract<SessionOutboundMessage, {
478
484
  export type SourceAssignPayload = Extract<SessionOutboundMessage, {
479
485
  type: "source/assign/response";
480
486
  }>["payload"];
487
+ export type SourceItemsPayload = Extract<SessionOutboundMessage, {
488
+ type: "source/items/response";
489
+ }>["payload"];
481
490
  export type IngestionFilterListPayload = Extract<SessionOutboundMessage, {
482
491
  type: "ingestion/filter/list/response";
483
492
  }>["payload"];
@@ -696,6 +705,8 @@ export interface SourceCheckOptions {
696
705
  export interface SourceSubscribeOptions {
697
706
  sourceId: string;
698
707
  componentId?: string;
708
+ /** Values for the trigger's own props, by name (e.g. `{ drive: "My Drive" }`). */
709
+ props?: Record<string, unknown>;
699
710
  requestId?: string;
700
711
  }
701
712
  export interface SourceDisconnectOptions {
@@ -712,12 +723,32 @@ export interface SourceAccountsOptions {
712
723
  sourceId: string;
713
724
  requestId?: string;
714
725
  }
726
+ export interface SourceActionsOptions {
727
+ sourceId: string;
728
+ requestId?: string;
729
+ }
730
+ export interface SourceRunOptions {
731
+ sourceId: string;
732
+ /** The action component id, as `source/actions` lists it (e.g. "gmail-send-email"). */
733
+ actionId: string;
734
+ /** The action's own input. The account is never part of it. */
735
+ props: Record<string, unknown>;
736
+ requestId?: string;
737
+ }
715
738
  export interface SourceAssignOptions {
716
739
  sourceId: string;
717
740
  /** The aggregator account id, as `source/accounts` reports it. */
718
741
  accountId: string;
719
742
  requestId?: string;
720
743
  }
744
+ export interface SourceItemsOptions {
745
+ sourceId: string;
746
+ /** Epoch ms, inclusive. Nothing older comes back. */
747
+ sinceMs: number;
748
+ /** Events read from each deployed trigger. Absent means the daemon's default. */
749
+ perTriggerLimit?: number;
750
+ requestId?: string;
751
+ }
721
752
  export interface IngestionFilterListOptions {
722
753
  /** Absent means every filter on the daemon. */
723
754
  sourceId?: string;
@@ -1566,6 +1597,10 @@ export declare class DaemonClient {
1566
1597
  sourceId: string;
1567
1598
  requestId?: string;
1568
1599
  }): Promise<SourceTriggersPayload>;
1600
+ /** The actions this source's app offers. Read-only. */
1601
+ sourceActions(options: SourceActionsOptions): Promise<SourceActionsPayload>;
1602
+ /** Run one action as the source's bound account. Not idempotent: never retry blindly. */
1603
+ sourceRun(options: SourceRunOptions): Promise<SourceRunPayload>;
1569
1604
  sourceSubscribe(options: SourceSubscribeOptions): Promise<SourceSubscribePayload>;
1570
1605
  sourceDisconnect(options: SourceDisconnectOptions): Promise<SourceDisconnectPayload>;
1571
1606
  /** Give a source the user's own name, or clear it. Local only. */
@@ -1574,6 +1609,14 @@ export declare class DaemonClient {
1574
1609
  sourceAccounts(options: SourceAccountsOptions): Promise<SourceAccountsPayload>;
1575
1610
  /** Point a source at one of those accounts. A refusal comes back as `reason`. */
1576
1611
  sourceAssign(options: SourceAssignOptions): Promise<SourceAssignPayload>;
1612
+ /**
1613
+ * The recent items of one source, payloads included. Read-only: the daemon
1614
+ * side creates, writes, arms and spawns nothing.
1615
+ *
1616
+ * A failed read resolves with `payload.error` set rather than rejecting, so a
1617
+ * caller can tell an empty window from a read that never happened.
1618
+ */
1619
+ sourceItems(options: SourceItemsOptions): Promise<SourceItemsPayload>;
1577
1620
  loopRun(options: RunLoopOptions): Promise<LoopRunPayload>;
1578
1621
  loopList(requestId?: string): Promise<LoopListPayload>;
1579
1622
  loopInspect(options: string | InspectLoopOptions): Promise<LoopInspectPayload>;
@@ -4387,6 +4387,27 @@ export class DaemonClient {
4387
4387
  responseType: "source/triggers/response",
4388
4388
  });
4389
4389
  }
4390
+ /** The actions this source's app offers. Read-only. */
4391
+ async sourceActions(options) {
4392
+ return this.sendCorrelatedSessionRequest({
4393
+ requestId: options.requestId,
4394
+ message: { type: "source/actions", sourceId: options.sourceId },
4395
+ responseType: "source/actions/response",
4396
+ });
4397
+ }
4398
+ /** Run one action as the source's bound account. Not idempotent: never retry blindly. */
4399
+ async sourceRun(options) {
4400
+ return this.sendCorrelatedSessionRequest({
4401
+ requestId: options.requestId,
4402
+ message: {
4403
+ type: "source/run",
4404
+ sourceId: options.sourceId,
4405
+ actionId: options.actionId,
4406
+ props: options.props,
4407
+ },
4408
+ responseType: "source/run/response",
4409
+ });
4410
+ }
4390
4411
  async sourceSubscribe(options) {
4391
4412
  return this.sendCorrelatedSessionRequest({
4392
4413
  requestId: options.requestId,
@@ -4394,6 +4415,7 @@ export class DaemonClient {
4394
4415
  type: "source/subscribe",
4395
4416
  sourceId: options.sourceId,
4396
4417
  ...(options.componentId === undefined ? {} : { componentId: options.componentId }),
4418
+ ...(options.props === undefined ? {} : { props: options.props }),
4397
4419
  },
4398
4420
  responseType: "source/subscribe/response",
4399
4421
  });
@@ -4440,6 +4462,27 @@ export class DaemonClient {
4440
4462
  responseType: "source/assign/response",
4441
4463
  });
4442
4464
  }
4465
+ /**
4466
+ * The recent items of one source, payloads included. Read-only: the daemon
4467
+ * side creates, writes, arms and spawns nothing.
4468
+ *
4469
+ * A failed read resolves with `payload.error` set rather than rejecting, so a
4470
+ * caller can tell an empty window from a read that never happened.
4471
+ */
4472
+ async sourceItems(options) {
4473
+ return this.sendCorrelatedSessionRequest({
4474
+ requestId: options.requestId,
4475
+ message: {
4476
+ type: "source/items",
4477
+ sourceId: options.sourceId,
4478
+ sinceMs: options.sinceMs,
4479
+ ...(options.perTriggerLimit === undefined
4480
+ ? {}
4481
+ : { perTriggerLimit: options.perTriggerLimit }),
4482
+ },
4483
+ responseType: "source/items/response",
4484
+ });
4485
+ }
4443
4486
  async loopRun(options) {
4444
4487
  return this.sendCorrelatedSessionRequest({
4445
4488
  requestId: options.requestId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperdrive.bot/fleet-client",
3
- "version": "0.3.179",
3
+ "version": "0.3.181",
4
4
  "description": "Paseo client SDK package",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -36,8 +36,8 @@
36
36
  "test": "vitest run"
37
37
  },
38
38
  "dependencies": {
39
- "@hyperdrive.bot/fleet-protocol": "0.3.179",
40
- "@hyperdrive.bot/fleet-relay": "0.3.179",
39
+ "@hyperdrive.bot/fleet-protocol": "0.3.181",
40
+ "@hyperdrive.bot/fleet-relay": "0.3.181",
41
41
  "zod": "^4.4.3"
42
42
  },
43
43
  "devDependencies": {