code-yeongyu/oh-my-openagent / packages/omo-senpi/skills/omo-relay
omo-relay
VerifiedWorks on the account's other devices through omo's built-in relay from a js eval cell: run a command or a long job on another machine, read, write, edit or search its files, copy a directory tree to or from it, and run one operation on every machine, on chosen machines or on several threads at once with one outcome per target. Use when the user names another device, machine, host or computer of the account, asks for something on every machine or on all or several threads at once, or wants a fan-out or a remote command or file.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.6 KB |
| references/errors.md | markdown | 1.4 KB |
| references/machines.md | markdown | 3.1 KB |
| references/parallel.md | markdown | 3.1 KB |
| scripts/sdk/bind-eval.test.ts | script | 2.7 KB |
| scripts/sdk/bind-eval.ts | script | 5.7 KB |
| scripts/sdk/conformance.test.ts | script | 654 B |
| scripts/sdk/index.ts | script | 454 B |
| scripts/sdk/machines.test.ts | script | 5.4 KB |
| scripts/sdk/machines.ts | script | 5.2 KB |
| scripts/sdk/outcome.ts | script | 3.3 KB |
| scripts/sdk/ports.ts | script | 2.9 KB |
| scripts/sdk/threads.test.ts | script | 4.1 KB |
| scripts/sdk/threads.ts | script | 3.3 KB |
| scripts/sdk/tsconfig.json | config | 522 B |
| scripts/sdk/write-nothing.test.ts | script | 2.9 KB |
scripts/sdk/outcome.ts
View on GitHubimport type { PortError } from "./ports.ts"
export type Settled<Target, Value> =
| { readonly kind: "fulfilled"; readonly target: Target; readonly value: Value }
| { readonly kind: "rejected"; readonly target: Target; readonly error: PortError }
| { readonly kind: "skipped"; readonly target: Target; readonly reason: string }
export type BatchResult<Target, Value> = {
readonly outcomes: readonly Settled<Target, Value>[]
readonly fulfilled: readonly Extract<Settled<Target, Value>, { kind: "fulfilled" }>[]
readonly rejected: readonly Extract<Settled<Target, Value>, { kind: "rejected" }>[]
readonly skipped: readonly Extract<Settled<Target, Value>, { kind: "skipped" }>[]
readonly ok: boolean
}
export type BatchOptions = { readonly concurrency?: number }
const CALLBACK_NEXT_ACTION = "the callback failed on this target only; read the message, then rerun it for this target"
export function batchOf<Target, Value>(outcomes: readonly Settled<Target, Value>[]): BatchResult<Target, Value> {
const fulfilled: Extract<Settled<Target, Value>, { kind: "fulfilled" }>[] = []
const rejected: Extract<Settled<Target, Value>, { kind: "rejected" }>[] = []
const skipped: Extract<Settled<Target, Value>, { kind: "skipped" }>[] = []
for (const outcome of outcomes) {
if (outcome.kind === "fulfilled") fulfilled.push(outcome)
else if (outcome.kind === "rejected") rejected.push(outcome)
else skipped.push(outcome)
}
return { outcomes, fulfilled, rejected, skipped, ok: rejected.length === 0 && skipped.length === 0 }
}
function stringField(value: object, key: string): string | undefined {
const field: unknown = Reflect.get(value, key)
return typeof field === "string" && field.length > 0 ? field : undefined
}
/** Reads `{ code, message, next_action, uncertain }` off anything a callback or the fleet client threw. */
export function portErrorOf(thrown: unknown): PortError {
if (typeof thrown !== "object" || thrown === null) {
return { code: "callback_failed", message: String(thrown), next_action: CALLBACK_NEXT_ACTION }
}
const message = stringField(thrown, "message") ?? String(thrown)
const uncertain = Reflect.get(thrown, "uncertain") === true
return {
code: stringField(thrown, "code") ?? "callback_failed",
message,
next_action: stringField(thrown, "next_action") ?? CALLBACK_NEXT_ACTION,
...(uncertain ? { uncertain } : {}),
}
}
/**
* Runs `task` for every item with at most `concurrency` in flight (unbounded when omitted, as the fleet
* client's own default is) and keeps input order. Callers pass tasks that settle to data and never reject.
*/
export async function settleEach<Item, Result>(
items: readonly Item[],
task: (item: Item) => Promise<Result>,
concurrency: number | undefined,
): Promise<Result[]> {
if (concurrency === undefined) return Promise.all(items.map(task))
if (!Number.isInteger(concurrency) || concurrency < 1) {
throw new RangeError(`concurrency must be a positive integer, got ${concurrency}`)
}
const results = new Array<Result>(items.length)
let next = 0
const worker = async (): Promise<void> => {
while (next < items.length) {
const index = next
next += 1
const item = items[index]
if (item !== undefined) results[index] = await task(item)
}
}
await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, worker))
return results
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |