actorctl 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/actorctl.js +21 -4
  2. package/package.json +1 -1
package/dist/actorctl.js CHANGED
@@ -36674,6 +36674,10 @@ var Runtime2 = exports_HttpApiGroup.make("runtime").add(exports_HttpApiEndpoint.
36674
36674
  params: { ...actorParams, thread: Identifier, id: Identifier },
36675
36675
  success: Call,
36676
36676
  error: errors
36677
+ }), exports_HttpApiEndpoint.get("getMethodCall", `${actorPath}/threads/:thread/methods/:method/calls/:id`, {
36678
+ params: { ...actorParams, thread: Identifier, method: Identifier, id: Identifier },
36679
+ success: Call,
36680
+ error: errors
36677
36681
  }), exports_HttpApiEndpoint.post("cancelCall", `${actorPath}/threads/:thread/calls/:id/cancel`, {
36678
36682
  params: { ...actorParams, thread: Identifier, id: Identifier },
36679
36683
  payload: exports_Schema.Struct({ reason: exports_Schema.String }),
@@ -36889,7 +36893,8 @@ var call = exports_Command.make("call", {
36889
36893
  method: exports_Argument.String("method"),
36890
36894
  thread: nonempty("thread"),
36891
36895
  input: exports_Flag.String("input").pipe(exports_Flag.withDescription("Method input as JSON.")),
36892
- key: optional6("key", "Idempotency key; generated when omitted. Reuse it to retry a call.")
36896
+ key: optional6("key", "Idempotency key; generated when omitted. Reuse it to retry a call."),
36897
+ wait: exports_Flag.Boolean("wait").pipe(exports_Flag.withDefault(false), exports_Flag.withDescription("Wait for the call to finish and print its result."))
36893
36898
  }, (flags) => exports_Effect.gen(function* () {
36894
36899
  const config = yield* resolveConfig(flags);
36895
36900
  const name = yield* requireActor(config);
@@ -36901,8 +36906,20 @@ var call = exports_Command.make("call", {
36901
36906
  headers: { "idempotency-key": key },
36902
36907
  payload
36903
36908
  }).pipe(exports_Effect.mapError((error2) => new Error(`Call ${key}: ${userError(error2).userMessage} Retry with --key ${key} and the same input.`)));
36904
- yield* print(flags.json, result3, [`${result3.id} accepted${result3.position === undefined ? "" : ` at ${result3.position}`}`]);
36905
- }).pipe(exports_Effect.mapError(userError))).pipe(exports_Command.withDescription("Invoke an actor method and print its receipt."));
36909
+ if (!flags.wait)
36910
+ return yield* print(flags.json, result3, [`${result3.id} accepted${result3.position === undefined ? "" : ` at ${result3.position}`}`]);
36911
+ const params = { account: config.account, name, thread: flags.thread, method: flags.method, id: result3.id };
36912
+ let state = yield* client.runtime.getMethodCall({ params });
36913
+ while (state.status === "pending") {
36914
+ yield* exports_Effect.sleep(DEFAULT_EVENT_POLL_INTERVAL_MS);
36915
+ state = yield* client.runtime.getMethodCall({ params });
36916
+ }
36917
+ if (flags.json)
36918
+ return yield* exports_Console.log(JSON.stringify(state));
36919
+ if (state.status === "completed")
36920
+ return yield* exports_Console.log(JSON.stringify(state.output, null, 2));
36921
+ return yield* exports_Effect.fail(new Error(`Call ${result3.id} ${state.status}: ${state.status === "failed" ? state.error : state.reason}`));
36922
+ }).pipe(exports_Effect.mapError(userError))).pipe(exports_Command.withDescription("Invoke an actor method and print its receipt, or its result with --wait."));
36906
36923
  var sequenceFlag = (name, description) => exports_Flag.Int(name).pipe(exports_Flag.withSchema(exports_Schema.Int.check(exports_Schema.isGreaterThanOrEqualTo(0))), exports_Flag.optional, exports_Flag.withDescription(description));
36907
36924
  var countFlag = (name, description) => exports_Flag.Int(name).pipe(exports_Flag.withSchema(exports_Schema.Int.check(exports_Schema.isGreaterThan(0))), exports_Flag.optional, exports_Flag.withDescription(description));
36908
36925
  var PAGE_LIMIT = 1000;
@@ -37429,7 +37446,7 @@ var actorctl = exports_Command.make("actorctl").pipe(exports_Command.withDescrip
37429
37446
  exports_Command.make("secrets").pipe(exports_Command.withSubcommands([secretsPut, secretsDelete]))
37430
37447
  ]));
37431
37448
  // package.json
37432
- var version2 = "0.1.1";
37449
+ var version2 = "0.1.2";
37433
37450
 
37434
37451
  // src/main.ts
37435
37452
  exports_Command.run(actorctl, { version: version2 }).pipe(exports_Effect.provide(exports_Layer.mergeAll(exports_BunServices.layer, exports_FetchHttpClient.layer)), exports_BunRuntime.runMain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "actorctl",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Deploy actors, run threads, and read events on Tardigrade Cloud.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",