openpond-sdk 0.0.10 → 0.0.12

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/README.md CHANGED
@@ -119,6 +119,25 @@ await openpond.workflows.runNow(workflow.scheduleId);
119
119
  await openpond.workflows.update(workflow.scheduleId, { enabled: false });
120
120
  ```
121
121
 
122
+ An external product can also let OpenPond own recurrence while keeping the
123
+ work itself inside that product. External callbacks are created disabled by
124
+ default by the caller, carry only an opaque external reference, and receive a
125
+ verifiable Saved Work run identity when OpenPond fires them:
126
+
127
+ ```ts
128
+ await openpond.workflows.create({
129
+ name: "Daily account review",
130
+ prompt: "Run the account-owned daily review.",
131
+ recurrence,
132
+ enabled: false,
133
+ target: {
134
+ kind: "external_callback",
135
+ callbackUrl: "https://app.example.com/api/workflows/openpond-callback",
136
+ externalReference: "opaque_binding_id",
137
+ },
138
+ });
139
+ ```
140
+
122
141
  `openpond.workflows` is distinct from `openpond.sandboxes.createSchedule()`. Workflows schedule model-driven Work and create normal Work conversations and run history. Raw sandbox schedules execute a declared sandbox command or action.
123
142
 
124
143
  ## Project Actions
package/dist/index.js CHANGED
@@ -2591,6 +2591,37 @@ var OpenPondProfileActionsClient = class {
2591
2591
  "Get Profile Action catalog"
2592
2592
  )).catalog;
2593
2593
  }
2594
+ async run(input) {
2595
+ const teamId = requiredValue(input.teamId, "teamId");
2596
+ const actionKey = requiredValue(input.actionKey, "actionKey");
2597
+ const idempotencyKey = requiredValue(input.idempotencyKey, "idempotencyKey");
2598
+ const catalogVersion = requiredValue(input.catalogVersion, "catalogVersion");
2599
+ const response = await apiFetch(
2600
+ this.#apiBaseUrl,
2601
+ this.#apiKey,
2602
+ `/v1/profile/actions/run?${new URLSearchParams({ teamId }).toString()}`,
2603
+ {
2604
+ method: "POST",
2605
+ headers: { "Content-Type": "application/json" },
2606
+ body: JSON.stringify({
2607
+ ...input.profileId?.trim() ? { profileId: input.profileId.trim() } : {},
2608
+ ...input.profileName?.trim() ? { profileName: input.profileName.trim() } : {},
2609
+ actionKey,
2610
+ value: input.value ?? {},
2611
+ conversationId: input.conversationId ?? null,
2612
+ createConversation: input.createConversation,
2613
+ conversationTitle: input.conversationTitle ?? null,
2614
+ idempotencyKey,
2615
+ catalogVersion,
2616
+ externalCapabilityLeases: input.externalCapabilityLeases
2617
+ })
2618
+ }
2619
+ );
2620
+ return readApiJson(
2621
+ response,
2622
+ "Run Profile Action"
2623
+ );
2624
+ }
2594
2625
  };
2595
2626
  function requiredValue(value, name) {
2596
2627
  const normalized = value.trim();