ToolContext
What a tool’s run and drop receive: the extension’s usual ctx, plus what tools need.
Extends
Section titled “Extends”Properties
Section titled “Properties”dataDir
Section titled “dataDir”dataDir:
string
A folder only this extension writes to, created on first use. A file a tool
returns (files, image, a drop’s outputs) must be inside it or be one the
user gave the tool in this run; anything else is dropped from the output.
extensionId
Section titled “extensionId”extensionId:
string
Inherited from
Section titled “Inherited from”log:
Logger
Inherited from
Section titled “Inherited from”oauth:
OAuth
Sign-in to the services your manifest declares in oauth, run by the app.
Inherited from
Section titled “Inherited from”preferences
Section titled “preferences”preferences:
Preferences
Inherited from
Section titled “Inherited from”secrets
Section titled “secrets”secrets:
Secrets
Keychain-backed; use for tokens, never storage (a plain file).
Inherited from
Section titled “Inherited from”signal
Section titled “signal”signal:
AbortSignal
Aborted when the run times out. Pass it to fetch so a slow request stops with it.
storage
Section titled “storage”storage:
Storage
Inherited from
Section titled “Inherited from”trigger
Section titled “trigger”trigger:
Trigger
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”emit()
Section titled “emit()”emit(
blip):void
Emits a full snapshot for one blip. Call once per changed item, not a diff.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
blip |
BlipInput |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”end(
key,options?):void
Marks a blip finished; surfaces show the final state, then dismiss it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
options? |
{ dismissAfter?: number; state?: "success" | "failure"; } |
options.dismissAfter? |
number |
options.state? |
"success" | "failure" |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”exec()
Section titled “exec()”exec(
file,args?,options?):Promise<ExecResult>
Runs an executable listed in permissions.exec. Rejects if it isn’t.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file |
string |
args? |
string[] |
options? |
{ cwd?: string; timeoutMs?: number; } |
options.cwd? |
string |
options.timeoutMs? |
number |
Returns
Section titled “Returns”Promise<ExecResult>
Inherited from
Section titled “Inherited from”notify()
Section titled “notify()”notify(
title,body?):Promise<void>
A line under the notch for a few seconds, for the result of something the user just did.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
title |
string |
body? |
string |
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”openURL()
Section titled “openURL()”openURL(
url):Promise<void>
Opens a URL with the user’s default handler.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
url |
string |
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”remove()
Section titled “remove()”remove(
key):void
Removes a blip immediately, with no final-state flourish.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”respond()
Section titled “respond()”respond(
replyId,body,status?):void
Completes a webhook request that’s being held on event.replyId.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
replyId |
string |
body |
unknown |
status? |
number |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setPreference()
Section titled “setPreference()”setPreference(
name,value):Promise<void>
Changes one of your own options (never a password), as if it were changed in
Settings: it’s saved, and update() runs again with it. For a button that sets
something up in one press (“Keep watching this repository”). undefined clears it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
value |
string | number | boolean | undefined |
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”workingHours()
Section titled “workingHours()”workingHours():
Promise<WorkingHours|undefined>
The person’s working hours, or undefined when they haven’t set any (every hour is one).
Returns
Section titled “Returns”Promise<WorkingHours | undefined>