Skip to content
Rigel docs
Open Rigel

Set up a trigger for Rigel

agent.trigger.create

POST/api/v1/households/{household_id}/commands/agent.trigger.create

  • Command
  • Rigel runs it
  • Applies offline

Sets up work Rigel does after something happens, such as "when a recipe is cooked, ask that evening how it went" or "when something is added to the shopping list, check the pantry has none". Use it when someone asks for a reaction to a change, not for a time schedule (that is a routine). Name the commands that set it off in commands (tool names with dots), say when to act after them in when, and give a title in plain words for the settings list and a task written for a run with nobody present: the run is shown what happened. It runs with the authority of for_person_id (default: the person asking) and may only tell the family through dashboard cards and notifications. Fails with unknown_command if a name is not a command, person_not_found if for_person_id isn't in the household, and person_required if nobody is named and the requester has no person. Returns the trigger's ID.

Parameters#

Set up a trigger for Rigel: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

Idempotency-Keyheaderstringoptional

The command's ID. Reuse it when retrying the same command.

Request body#

JSON, as application/json.

Set up a trigger for Rigel: request body fields
FieldDescription
titlestringrequired

What the routine does in plain words for the list in settings, 1–120 characters, such as "Suggest a new recipe on Wednesdays".

1 to 120 characters
taskstringrequired

The instructions Rigel follows each time, up to 4000 characters, written to be read with nobody around: what to check, when to do something, and what to leave alone.

1 to 4,000 characters
appone of: meals, recipes, shopping, inventory, calendar, email, tasks, documents, chat, maintenance, null or nulloptional

The app whose guide Rigel reads for this work; null or left out for none.

for_person_idstringoptional

Whose authority it runs with and who it is for. Defaults to the person asking.

commandsarray of stringsrequired

The commands that set it off, 1–20, by tool name with dots, such as ["recipes.cook.log"]. Any command that is not internal; the tool names you can call are the ones to use.

1 to 20 items
whenone of 3 shapesrequired

When Rigel acts after the event: "soon" (about a minute after, so a burst of changes is one run), "after" some minutes, or "at" a time of day (the next time the household's clock shows it, at least a minute after the event). Example: { "kind": "at", "time": "19:00" }.

Shape 1
when.kindone of: soonrequiredNo description.
Shape 2, with minutes
when.kindone of: afterrequiredNo description.
when.minutesintegerrequired

How long after the event, 1 to 1,440 minutes (one day).

1 to 1,440
Shape 3, with time
when.kindone of: atrequiredNo description.
when.timestringrequired

The time of day in the household's time zone, 24-hour "HH:MM", such as "09:00".

pattern ^([01]\d|2[0-3]):[0-5]\d$

Response#

200 The command was applied.

Set up a trigger for Rigel: response fields
FieldDescription
resultobjectrequired

What the command returned, such as the IDs it created.

result.trigger_idstringrequired

The new trigger.

versionintegerrequired

The household version after the command.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Set up a trigger for Rigel: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404person_not_foundA person who isn't in the household.
404not_foundThe household doesn't exist, or you aren't a member of it.
409unknown_command
  • A name that is not a command.
  • An internal command can't be watched.
  • A query name is not a command.
409idempotency_key_reusedThe Idempotency-Key was already used for a different command.

Examples#

These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.

Sets up a trigger for the person asking

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "title": "Ask how a new recipe went",
  "task": "Ask how it went.",
  "app": "recipes",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "at",
    "time": "19:00"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Ask how a new recipe went",
    task: "Ask how it went.",
    app: "recipes",
    commands: [
      "recipes.cook.log",
    ],
    when: {
      kind: "at",
      time: "19:00",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "title": "Ask how a new recipe went",
  "task": "Ask how it went.",
  "app": "recipes",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "at",
    "time": "19:00"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0GSP1QNAK5YJVDJMP

{
  "result": {
    "trigger_id": "trg_01JC4N0000MBGE5RJ6Q7V6V6T8"
  },
  "version": 1
}

For someone else, watching several commands, after some minutes

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000BBBBBBBBBBBBBBBB' \
  -d '{
  "title": "Check the pantry",
  "task": "Check the pantry has none.",
  "for_person_id": "per_01JC000000000000000000000A",
  "commands": [
    "inventory.item.add",
    "inventory.item.adjust"
  ],
  "when": {
    "kind": "after",
    "minutes": 30
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000BBBBBBBBBBBBBBBB",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Check the pantry",
    task: "Check the pantry has none.",
    for_person_id: "per_01JC000000000000000000000A",
    commands: [
      "inventory.item.add",
      "inventory.item.adjust",
    ],
    when: {
      kind: "after",
      minutes: 30,
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000BBBBBBBBBBBBBBBB

{
  "title": "Check the pantry",
  "task": "Check the pantry has none.",
  "for_person_id": "per_01JC000000000000000000000A",
  "commands": [
    "inventory.item.add",
    "inventory.item.adjust"
  ],
  "when": {
    "kind": "after",
    "minutes": 30
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R01AK9B176BB9D3025

{
  "result": {
    "trigger_id": "trg_01JC4N00004J057T2A2FXGZEXG"
  },
  "version": 1
}

Soon

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000CCCCCCCCCCCCCCCC' \
  -d '{
  "title": "Tell me",
  "task": "Tell me.",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000CCCCCCCCCCCCCCCC",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Tell me",
    task: "Tell me.",
    commands: [
      "recipes.cook.log",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000CCCCCCCCCCCCCCCC

{
  "title": "Tell me",
  "task": "Tell me.",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0Q7XMSSC51V3ESMRT

{
  "result": {
    "trigger_id": "trg_01JC4N0000MF7D5SWWQQ5KK6CM"
  },
  "version": 1
}

A name that is not a command

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000DDDDDDDDDDDDDDDD' \
  -d '{
  "title": "Typo",
  "task": "Never fires.",
  "commands": [
    "recipes.cook.recrod"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000DDDDDDDDDDDDDDDD",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Typo",
    task: "Never fires.",
    commands: [
      "recipes.cook.recrod",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000DDDDDDDDDDDDDDDD

{
  "title": "Typo",
  "task": "Never fires.",
  "commands": [
    "recipes.cook.recrod"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0TJAECKR1KVW3MRBZ

{
  "error": {
    "code": "unknown_command",
    "message": "There's no command named recipes.cook.recrod. Use the exact tool names, with dots. No changes were applied.",
    "details": {
      "commands": [
        "recipes.cook.recrod"
      ]
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0TJAECKR1KVW3MRBZ"
  }
}

An internal command can't be watched

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000EEEEEEEEEEEEEEEE' \
  -d '{
  "title": "Internal",
  "task": "Not allowed.",
  "commands": [
    "recipes.cook.log",
    "agent.trigger.ran"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000EEEEEEEEEEEEEEEE",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Internal",
    task: "Not allowed.",
    commands: [
      "recipes.cook.log",
      "agent.trigger.ran",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000EEEEEEEEEEEEEEEE

{
  "title": "Internal",
  "task": "Not allowed.",
  "commands": [
    "recipes.cook.log",
    "agent.trigger.ran"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0H7GPKKP2AQ8FAWW4

{
  "error": {
    "code": "unknown_command",
    "message": "There's no command named agent.trigger.ran. Use the exact tool names, with dots. No changes were applied.",
    "details": {
      "commands": [
        "agent.trigger.ran"
      ]
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0H7GPKKP2AQ8FAWW4"
  }
}

A query name is not a command

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000FFFFFFFFFFFFFFFF' \
  -d '{
  "title": "Query",
  "task": "Not allowed.",
  "commands": [
    "agent.trigger.list"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000FFFFFFFFFFFFFFFF",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Query",
    task: "Not allowed.",
    commands: [
      "agent.trigger.list",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000FFFFFFFFFFFFFFFF

{
  "title": "Query",
  "task": "Not allowed.",
  "commands": [
    "agent.trigger.list"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0NW4R2DG4PFXPQJWA

{
  "error": {
    "code": "unknown_command",
    "message": "There's no command named agent.trigger.list. Use the exact tool names, with dots. No changes were applied.",
    "details": {
      "commands": [
        "agent.trigger.list"
      ]
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0NW4R2DG4PFXPQJWA"
  }
}

A person who isn't in the household

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000HHHHHHHHHHHHHHHH' \
  -d '{
  "title": "Who?",
  "task": "Nobody.",
  "for_person_id": "per_01JC000000000000000000000Z",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000HHHHHHHHHHHHHHHH",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Who?",
    task: "Nobody.",
    for_person_id: "per_01JC000000000000000000000Z",
    commands: [
      "recipes.cook.log",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000HHHHHHHHHHHHHHHH

{
  "title": "Who?",
  "task": "Nobody.",
  "for_person_id": "per_01JC000000000000000000000Z",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0NX7Z0B812B2K80DE

{
  "error": {
    "code": "person_not_found",
    "message": "That person isn't in the household. No changes were applied.",
    "details": {
      "person_id": "per_01JC000000000000000000000Z"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0NX7Z0B812B2K80DE"
  }
}

Set up a trigger

Work Rigel does after something happens: it names the commands that set it off, and how long after to act.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CTCG4J1SPNDVF3C898WX' \
  -d '{
  "title": "Ask how a new recipe went",
  "task": "When a recipe is cooked for the first time, ask that evening how it went and whether to keep it in the rotation.",
  "app": "recipes",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "after",
    "minutes": 120
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CTCG4J1SPNDVF3C898WX",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Ask how a new recipe went",
    task: "When a recipe is cooked for the first time, ask that evening how it went and whether to keep it in the rotation.",
    app: "recipes",
    commands: [
      "recipes.cook.log",
    ],
    when: {
      kind: "after",
      minutes: 120,
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTCG4J1SPNDVF3C898WX

{
  "title": "Ask how a new recipe went",
  "task": "When a recipe is cooked for the first time, ask that evening how it went and whether to keep it in the rotation.",
  "app": "recipes",
  "commands": [
    "recipes.cook.log"
  ],
  "when": {
    "kind": "after",
    "minutes": 120
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTCGHA6DMER74GQB46FV

{
  "result": {
    "trigger_id": "trg_01M6V9CTCG6HY7NK67ENWMSS1Z"
  },
  "version": 318
}

Set up a trigger that acts right away

soon acts a moment after the command, once a burst of changes settles.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CTCJ23MWNHSHDMMXT58V' \
  -d '{
  "title": "Restock the furnace filter",
  "task": "When the furnace filter task is checked off, look at the pantry. If there is no spare filter, add a pack to the shopping list.",
  "app": "maintenance",
  "commands": [
    "maintenance.task.complete"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CTCJ23MWNHSHDMMXT58V",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Restock the furnace filter",
    task: "When the furnace filter task is checked off, look at the pantry. If there is no spare filter, add a pack to the shopping list.",
    app: "maintenance",
    commands: [
      "maintenance.task.complete",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTCJ23MWNHSHDMMXT58V

{
  "title": "Restock the furnace filter",
  "task": "When the furnace filter task is checked off, look at the pantry. If there is no spare filter, add a pack to the shopping list.",
  "app": "maintenance",
  "commands": [
    "maintenance.task.complete"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CTCJ9421NKM4N21PAPNX

{
  "result": {
    "trigger_id": "trg_01M6V9CTCJM5QBJAYNNWJSW67W"
  },
  "version": 319
}

Watch a command that doesn't exist

Command names are checked against the ones Rigel knows.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CTCK0TB7C2SJFHCG7DFF' \
  -d '{
  "title": "Watch a command that isn'\''t there",
  "task": "Do something.",
  "commands": [
    "tasks.task.explode"
  ],
  "when": {
    "kind": "soon"
  }
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CTCK0TB7C2SJFHCG7DFF",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    title: "Watch a command that isn't there",
    task: "Do something.",
    commands: [
      "tasks.task.explode",
    ],
    when: {
      kind: "soon",
    },
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/agent.trigger.create HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CTCK0TB7C2SJFHCG7DFF

{
  "title": "Watch a command that isn't there",
  "task": "Do something.",
  "commands": [
    "tasks.task.explode"
  ],
  "when": {
    "kind": "soon"
  }
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CTCK6ENVSHXH6CTG5P2Z

{
  "error": {
    "code": "unknown_command",
    "message": "There's no command named tasks.task.explode. Use the exact tool names, with dots. No changes were applied.",
    "details": {
      "commands": [
        "tasks.task.explode"
      ]
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01M6V9CTCK6ENVSHXH6CTG5P2Z"
  }
}

For Rigel#

Rigel's tool for this command is agent_trigger_create. Rigel runs this on its own, then says what it did. The agent guide has the rest.

Rigel is in early access, and sign-up is by invitation. Open Rigel