AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Resonate Advanced Reasoning

skill-resonatehq-resonate-skills-resonate-advanced-reasoning-typescript · by resonatehq

Advanced reasoning bridge between the Resonate specification (resonatehq/resonate-specification) and the Resonate TypeScript SDK. Use when mapping spec concepts (processes, executions, promises, coordination, recovery) to concrete SDK patterns and when validating correctness, durability, and failure semantics.

— No reviews yet
0 installs
35 views
0.0% view→install

Install

$ agentstack add skill-resonatehq-resonate-skills-resonate-advanced-reasoning-typescript

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-resonatehq-resonate-skills-resonate-advanced-reasoning-typescript)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● 2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Resonate Advanced Reasoning? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Resonate Advanced Reasoning

Spec Reference

The normative ground truth for promise lifecycle, handler semantics, and state transitions is the Resonate specification — an executable abstract machine in Lean 4:

  • Repository:
  • Key files: spec/01-objects/state.lean (promise/task state), spec/02-actions/ (P-*.lean for promise handlers, T-*.lean for task handlers, S-*.lean for schedule handlers)

When this skill and the spec diverge, the spec wins.

Overview

Use this skill to translate Resonate specification concepts into Resonate TypeScript SDK usage. Treat the spec as the mental model and the SDK as its concrete expression.

Spec to SDK Translation Map

System Model -> Runtime

  • Process -> a single Node.js process running new Resonate(...).
  • Logical process -> a group of interchangeable workers (group + target).
  • Message passing -> Async RPC over HTTP long poll (or Kafka/SQS transport).
  • Addressing -> poll://any@ or poll://id@ targets.

Execution Model -> SDK Semantics

  • Execution -> a durable function invocation.
  • Invoke event -> run, rpc, beginRun, or beginRpc.
  • Return event -> durable promise resolution stored by the server.
  • Durable promise -> the promise ID for each invocation step.
  • Resume -> internal callback that replays and continues after a promise resolves.

Programming Model -> SDK APIs

  • Durable function -> resonate.register("name", function* ...).
  • Local invocation -> ctx.run / ctx.beginRun.
  • Remote invocation -> ctx.rpc / ctx.beginRpc with target options.
  • External promise -> ctx.promise() and resonate.promises.resolve/reject/cancel.
  • Call graph -> inspect with resonate tree .
  • Root promise -> the top-level invocation ID passed to run or rpc.

Coordination Semantics (Spec -> SDK)

Eventual resumption

Spec: caller awaits a promise that is not yet resolved.

SDK:

  • Caller yields ctx.rpc(...) or ctx.beginRpc(...).
  • Resonate Server stores promise and registers resume callback.
  • Caller resumes after the promise is resolved.
function* parent(ctx: Context, id: string) {
  const child = yield* ctx.beginRpc(
    "child",
    id,
    ctx.options({ target: "poll://any@workers" })
  );
  const result = yield* child; // eventual resumption
  return result;
}

Immediate resumption

Spec: caller awaits a promise already resolved.

SDK:

  • On replay, yield* ctx.run(...) returns stored result immediately.
  • No new execution is spawned for the already-completed promise.
function* replayed(ctx: Context, id: string) {
  const cached = yield* ctx.run(step, id); // returns stored value
  return cached;
}

Recovery Semantics (Spec -> SDK)

Spec: interruption-transparent execution.

SDK:

  • Each yield* checkpoint writes a durable promise.
  • On crash, Resonate replays the function and reuses stored results.
  • Side effects must be wrapped in durable calls to avoid duplication.
function* durable(ctx: Context, id: string) {
  const v1 = yield* ctx.run(step1, id);
  const v2 = yield* ctx.run(step2, v1);
  return v2;
}

Determinism Requirements (Spec -> SDK)

Spec: execution should be equivalent with or without interruptions.

SDK:

  • Do not call Date.now(), Math.random(), or crypto.randomUUID() directly inside durable generator code — these return different values on replay, breaking equivalence.
  • SDK-sanctioned pattern: pass timestamps and random seeds as arguments from the caller into the workflow, then thread them through as ordinary parameters. The value is fixed at invocation time and stable across replays.
  • Ensure all return values are serializable.
// ✅ CORRECT — timestamp fixed at call site, stable on replay
await resonate.run("report/2024-01-15", generateReport, {
  asOf: Date.now(),       // captured once in the ephemeral world
  seed: Math.random(),    // ditto
});

function* generateReport(ctx: Context, { asOf, seed }: ReportInput) {
  // asOf and seed are ordinary parameters — same value on every replay
  const data = yield* ctx.run(fetchData, asOf);
  return data;
}

Idempotency and Promise IDs

Spec: durable promises deduplicate re-invocation.

SDK:

  • Top-level invocation ID is the idempotency key.
  • Reusing the same ID returns cached results.
  • Generate new IDs for a fresh execution.
await resonate.run("order/123", processOrder, "123");
await resonate.run("order/123", processOrder, "123"); // returns cached
await resonate.run("order/124", processOrder, "124"); // new execution

Local vs Remote Execution Reasoning

Spec: locality defines whether an invocation stays in-process or crosses processes.

SDK:

  • ctx.run stays local.
  • ctx.rpc crosses to another process group and resumes when resolved.
function* workflow(ctx: Context, input: string) {
  const local = yield* ctx.run(stepLocal, input);
  const remote = yield* ctx.rpc(
    "stepRemote",
    local,
    ctx.options({ target: "poll://any@workers" })
  );
  return remote;
}

Message Passing and Addressing

Spec: messages may be sent to a process or a group.

SDK:

  • Unicast: use a specific poll://id@group target.
  • Anycast: use poll://any@group to let the server route.
const result = yield* ctx.rpc(
  "task",
  data,
  ctx.options({ target: "poll://any@workers" })
);

Advanced Reasoning Checklist

  • Is each side effect behind a durable step (ctx.run or ctx.rpc)?
  • Are all durable return values serializable?
  • Are promise IDs stable and meaningful?
  • Does the target group match the worker group?
  • Are retries bounded with timeouts where appropriate?
  • Is concurrency structured (fork then join)?

When to Hand Off

  • Use resonate-basic-durable-world-usage-typescript for SDK usage patterns and hands-on TS authoring.
  • Use resonate-basic-debugging-typescript for runtime diagnosis.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.