openpond-sdk 0.0.7 → 0.0.10

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/dist/index.js CHANGED
@@ -1280,12 +1280,13 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
1280
1280
  }
1281
1281
  runAgent(agentId, input) {
1282
1282
  const query = new URLSearchParams({ teamId: input.teamId });
1283
+ const { teamId: _teamId, ...body } = input;
1283
1284
  return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/run?${query.toString()}`, {
1284
1285
  method: "POST",
1285
1286
  headers: {
1286
1287
  Prefer: "respond-async"
1287
1288
  },
1288
- body: JSON.stringify(input)
1289
+ body: JSON.stringify(body)
1289
1290
  });
1290
1291
  }
1291
1292
  getAgentSourceDeployPlan(agentId, input) {
@@ -1965,9 +1966,10 @@ async function* streamHostedChatTurn(options) {
1965
1966
  var DEFAULT_MODEL = "openpond-chat";
1966
1967
  var DEFAULT_MAX_STEPS = 24;
1967
1968
  var MAX_TOOL_OUTPUT_CHARS = 4e4;
1968
- var WORK_OUTPUT_DIRECTORY = "/workspace/outputs";
1969
- var WORK_INPUT_DIRECTORY = "/workspace/inputs/previous-outputs";
1970
- var WORK_INPUT_MANIFEST = "/workspace/inputs/.openpond-context.json";
1969
+ var MAX_WORK_COMMAND_CHARS = 2e4;
1970
+ var WORK_OUTPUT_DIRECTORY = "outputs";
1971
+ var WORK_INPUT_DIRECTORY = "inputs/previous-outputs";
1972
+ var WORK_INPUT_MANIFEST = "inputs/.openpond-context.json";
1971
1973
  var MAX_WORK_OUTPUTS = 100;
1972
1974
  var MAX_WORK_INPUTS = 100;
1973
1975
  var MAX_WORK_INPUT_BYTES = 100 * 1024 * 1024;
@@ -2285,6 +2287,11 @@ var OpenPondWorkClient = class {
2285
2287
  }
2286
2288
  const command = typeof args.command === "string" ? args.command.trim() : "";
2287
2289
  if (!command) return toolMessage(toolCallId, { error: "command is required" });
2290
+ if (command.length > MAX_WORK_COMMAND_CHARS) {
2291
+ const output = `command exceeds the ${MAX_WORK_COMMAND_CHARS} character limit`;
2292
+ await emit({ type: "tool", toolCallId, command, status: "failed", output });
2293
+ return toolMessage(toolCallId, { status: "failed", error: output });
2294
+ }
2288
2295
  await emit({ type: "tool", toolCallId, command, status: "started" });
2289
2296
  try {
2290
2297
  const response = await this.#sandboxes.exec(sandboxId, {
@@ -2324,7 +2331,12 @@ var WORK_TOOLS = [
2324
2331
  type: "object",
2325
2332
  additionalProperties: false,
2326
2333
  properties: {
2327
- command: { type: "string", description: "Shell command to execute." }
2334
+ command: {
2335
+ type: "string",
2336
+ minLength: 1,
2337
+ maxLength: MAX_WORK_COMMAND_CHARS,
2338
+ description: "Shell command to execute."
2339
+ }
2328
2340
  },
2329
2341
  required: ["command"]
2330
2342
  }
@@ -2554,6 +2566,38 @@ function projectActionPath(projectId, suffix, teamId) {
2554
2566
  return `/v1/project-actions/${encodeURIComponent(projectId)}/${suffix}?teamId=${encodeURIComponent(teamId)}`;
2555
2567
  }
2556
2568
 
2569
+ // src/profile-actions.ts
2570
+ var OpenPondProfileActionsClient = class {
2571
+ #apiKey;
2572
+ #apiBaseUrl;
2573
+ constructor(input) {
2574
+ this.#apiKey = input.apiKey;
2575
+ this.#apiBaseUrl = input.apiBaseUrl.replace(/\/+$/, "");
2576
+ }
2577
+ async catalog(input) {
2578
+ const teamId = requiredValue(input.teamId, "teamId");
2579
+ const search = new URLSearchParams({ teamId });
2580
+ if (input.profileId?.trim()) search.set("profileId", input.profileId.trim());
2581
+ if (input.profileName?.trim()) {
2582
+ search.set("profileName", input.profileName.trim());
2583
+ }
2584
+ const response = await apiFetch(
2585
+ this.#apiBaseUrl,
2586
+ this.#apiKey,
2587
+ `/v1/profile/actions?${search.toString()}`
2588
+ );
2589
+ return (await readApiJson(
2590
+ response,
2591
+ "Get Profile Action catalog"
2592
+ )).catalog;
2593
+ }
2594
+ };
2595
+ function requiredValue(value, name) {
2596
+ const normalized = value.trim();
2597
+ if (!normalized) throw new Error(`${name} is required`);
2598
+ return normalized;
2599
+ }
2600
+
2557
2601
  // src/workflows.ts
2558
2602
  import { randomUUID as randomUUID2 } from "node:crypto";
2559
2603
  var OpenPondWorkflowsClient = class {
@@ -2639,6 +2683,7 @@ var OpenPondClient = class {
2639
2683
  work;
2640
2684
  workflows;
2641
2685
  actions;
2686
+ profileActions;
2642
2687
  constructor(options) {
2643
2688
  const apiKey = options.apiKey.trim();
2644
2689
  if (!apiKey) throw new Error("OpenPond API key is required");
@@ -2656,6 +2701,7 @@ var OpenPondClient = class {
2656
2701
  });
2657
2702
  this.workflows = new OpenPondWorkflowsClient({ apiKey, apiBaseUrl });
2658
2703
  this.actions = new OpenPondProjectActionsClient({ apiKey, apiBaseUrl });
2704
+ this.profileActions = new OpenPondProfileActionsClient({ apiKey, apiBaseUrl });
2659
2705
  }
2660
2706
  };
2661
2707
  function createOpenPondClient(options) {
@@ -2664,6 +2710,7 @@ function createOpenPondClient(options) {
2664
2710
  export {
2665
2711
  OpenPondApiError,
2666
2712
  OpenPondClient,
2713
+ OpenPondProfileActionsClient,
2667
2714
  OpenPondProjectActionsClient,
2668
2715
  OpenPondSandboxClient,
2669
2716
  OpenPondWorkClient,