ticlawk 0.1.17-dev.4 → 0.1.17-dev.6
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.
package/package.json
CHANGED
|
@@ -375,7 +375,7 @@ export async function getAgentServerInfo({ actingAgentId }) {
|
|
|
375
375
|
// ── Reminders ──
|
|
376
376
|
|
|
377
377
|
export async function scheduleAgentReminder({
|
|
378
|
-
actingAgentId, title, fireAt, anchorConversationId, anchorMessageId,
|
|
378
|
+
actingAgentId, title, fireAt, anchorConversationId, anchorMessageId, recurrence,
|
|
379
379
|
}) {
|
|
380
380
|
return apiFetch('/api/agent/reminders', {
|
|
381
381
|
method: 'POST',
|
|
@@ -385,6 +385,7 @@ export async function scheduleAgentReminder({
|
|
|
385
385
|
fire_at: fireAt,
|
|
386
386
|
anchor_conversation_id: anchorConversationId,
|
|
387
387
|
anchor_message_id: anchorMessageId ?? null,
|
|
388
|
+
recurrence: recurrence ?? null,
|
|
388
389
|
}),
|
|
389
390
|
});
|
|
390
391
|
}
|
|
@@ -557,6 +557,18 @@ export async function runReminderScheduleCommand(args) {
|
|
|
557
557
|
console.error('--target or --anchor-conversation-id is required');
|
|
558
558
|
return 2;
|
|
559
559
|
}
|
|
560
|
+
// Optional recurrence: --recur-at HH:MM [--recur-tz <IANA>] [--recur-weekday 1,2,3].
|
|
561
|
+
// --fire-at remains the FIRST occurrence; the rule advances it after each fire.
|
|
562
|
+
let recurrence = null;
|
|
563
|
+
const recurAt = getArg(args, 'recur-at');
|
|
564
|
+
if (recurAt) {
|
|
565
|
+
const tz = getArg(args, 'recur-tz') || 'UTC';
|
|
566
|
+
const wdRaw = getArg(args, 'recur-weekday');
|
|
567
|
+
const byWeekday = wdRaw
|
|
568
|
+
? String(wdRaw).split(',').map((s) => parseInt(s.trim(), 10)).filter((n) => n >= 1 && n <= 7)
|
|
569
|
+
: [];
|
|
570
|
+
recurrence = { at: recurAt, tz, ...(byWeekday.length ? { by_weekday: byWeekday } : {}) };
|
|
571
|
+
}
|
|
560
572
|
const res = await daemonRequest({
|
|
561
573
|
method: 'POST',
|
|
562
574
|
path: '/agent/reminder/schedule',
|
|
@@ -567,6 +579,7 @@ export async function runReminderScheduleCommand(args) {
|
|
|
567
579
|
target,
|
|
568
580
|
anchor_conversation_id: anchorConversationId,
|
|
569
581
|
anchor_message_id: anchorMessageId,
|
|
582
|
+
recurrence,
|
|
570
583
|
},
|
|
571
584
|
});
|
|
572
585
|
printJson(res.body);
|
|
@@ -1425,7 +1438,7 @@ export const AGENT_COMMAND_HELP = {
|
|
|
1425
1438
|
to a user, use \`ticlawk message send --attach <file>\` instead.
|
|
1426
1439
|
`,
|
|
1427
1440
|
reminder: `ticlawk reminder <schedule|list|snooze|update|cancel|log>
|
|
1428
|
-
ticlawk reminder schedule --title <t> (--fire-at <iso> | --in-seconds N | --in-minutes N) (--target "<target>" | --anchor-conversation-id <id>) [--anchor-message-id <id>]
|
|
1441
|
+
ticlawk reminder schedule --title <t> (--fire-at <iso> | --in-seconds N | --in-minutes N) (--target "<target>" | --anchor-conversation-id <id>) [--anchor-message-id <id>] [--recur-at HH:MM [--recur-tz <IANA>] [--recur-weekday 1,2,3]]
|
|
1429
1442
|
ticlawk reminder list [--status active|fired|canceled]
|
|
1430
1443
|
ticlawk reminder snooze <reminder-id> (--fire-at <iso> | --in-seconds N | --in-minutes N)
|
|
1431
1444
|
ticlawk reminder update <reminder-id> [--title <t>] [--fire-at <iso>]
|
|
@@ -1435,6 +1448,17 @@ export const AGENT_COMMAND_HELP = {
|
|
|
1435
1448
|
Use reminders for follow-up that depends on future state you cannot resolve
|
|
1436
1449
|
now. A reminder fires by posting a system message into the anchor
|
|
1437
1450
|
conversation and waking the owner agent via an explicit delivery.
|
|
1451
|
+
|
|
1452
|
+
RECURRING: for a fixed cadence (e.g. a daily/weekly meal-time check-in), use
|
|
1453
|
+
ONE recurring reminder instead of enumerating many one-shots. Pass --recur-at
|
|
1454
|
+
(local HH:MM), --recur-tz (the owner's IANA timezone), and optionally
|
|
1455
|
+
--recur-weekday (ISO 1=Mon..7=Sun, comma-separated; omit for every day).
|
|
1456
|
+
--fire-at is still the FIRST occurrence; on each fire the reminder
|
|
1457
|
+
auto-advances to the next occurrence and stays active. Example — weekday
|
|
1458
|
+
18:30 Beijing dinner check-in:
|
|
1459
|
+
ticlawk reminder schedule --title "晚餐" --anchor-conversation-id <id> \\
|
|
1460
|
+
--fire-at <next 18:30 Beijing as ISO> \\
|
|
1461
|
+
--recur-at 18:30 --recur-tz Asia/Shanghai --recur-weekday 1,2,3,4,5
|
|
1438
1462
|
`,
|
|
1439
1463
|
task: `ticlawk task <create|claim|unclaim|update|list>
|
|
1440
1464
|
ticlawk task create --target "<target>" [--title <t>] [--assign-agent <agent-id>]
|
|
@@ -590,6 +590,7 @@ export async function handleReminderSchedule(req, body, ctx) {
|
|
|
590
590
|
fireAt: body.fire_at,
|
|
591
591
|
anchorConversationId,
|
|
592
592
|
anchorMessageId: body?.anchor_message_id || null,
|
|
593
|
+
recurrence: body?.recurrence ?? null,
|
|
593
594
|
});
|
|
594
595
|
debugLog('agent-cli', 'reminder.schedule', {
|
|
595
596
|
actingAgentId,
|
|
@@ -17,15 +17,15 @@ const STEP_GUIDES = {
|
|
|
17
17
|
title: 'GAP ANALYSIS',
|
|
18
18
|
body: `Compare the current state of the work against the goal and success criteria. Read whatever you need (charter, dashboard, task board, repo, prior messages) to judge where things actually stand. The dashboard is the owner's at-a-glance visualization of how far this goal has progressed — this step owns keeping it true to reality: if a durable goal has no dashboard yet, create it (\`ticlawk dashboard set\`); if overall progress has moved materially, refresh its content/data. See SURFACES.md.
|
|
19
19
|
- If there is concrete executable work toward the goal, first make sure the next unit exists as a task (create/assign it with \`ticlawk task ...\` when a task fits), then report outcome=gap.
|
|
20
|
-
- If the goal/milestone is fully met with no meaningful gap, make sure the dashboard reflects the completed state,
|
|
20
|
+
- If the goal/milestone is fully met with no meaningful gap, make sure the dashboard reflects the completed state, then report outcome=no_gap. (The completed result is something the owner is waiting on — surface it per the briefing rule below.)
|
|
21
21
|
- If closing the gap depends on a future or external state that nobody can act on right now, schedule a reminder for the resume condition, then report outcome=wait.`,
|
|
22
22
|
outcomes: ['gap', 'no_gap', 'wait'],
|
|
23
23
|
},
|
|
24
24
|
execute: {
|
|
25
25
|
title: 'EXECUTE',
|
|
26
|
-
body: `Do the next concrete unit of work toward the goal (or drive the current task to completion). Send interim
|
|
26
|
+
body: `Do the next concrete unit of work toward the goal (or drive the current task to completion). Send routine interim progress with \`ticlawk message send --phase progress\`; if an update clears the briefing bar below (e.g. it is a result the owner explicitly asked to be told about), surface it as a briefing instead.
|
|
27
27
|
- When the unit of work is finished and ready to be checked, report outcome=task_completed.
|
|
28
|
-
- If you cannot proceed without an owner approval, decision, or permission, park ONE canonical approval with \`ticlawk approval request --title "<what you need approved>" [--detail "<context>"]\`,
|
|
28
|
+
- If you cannot proceed without an owner approval, decision, or permission, park ONE canonical approval with \`ticlawk approval request --title "<what you need approved>" [--detail "<context>"]\`, tell the owner what you need and why, then report outcome=needs_approval. The owner's approval (button or a natural-language reply) resumes you automatically.
|
|
29
29
|
- If you are blocked by something else (missing input, external failure, a needed resource), explain it to the owner, then report outcome=blocked.`,
|
|
30
30
|
outcomes: ['task_completed', 'needs_approval', 'blocked'],
|
|
31
31
|
},
|
|
@@ -74,10 +74,16 @@ export function buildGoalStepPrompt(msg) {
|
|
|
74
74
|
`Current step: ${guide.title}`,
|
|
75
75
|
guide.body,
|
|
76
76
|
``,
|
|
77
|
+
`Briefing rule (independent of which step you are on): a briefing (\`ticlawk briefing publish\`) interrupts the owner — it is only for things worth their attention. Default to NOT sending one; routine progress belongs on the dashboard (the owner pulls it) or a chat \`ticlawk message send\`. Send a briefing only when one of these holds:`,
|
|
78
|
+
` (a) the owner must act or decide — e.g. an approval you parked (\`--mode approval\`);`,
|
|
79
|
+
` (b) the owner asked to be told about this — a standing request, a scheduled time, or a threshold they set (\`--mode info\`);`,
|
|
80
|
+
` (c) something happened the owner would be wrong not to know now — goal done, blocked, materially off-track, or a result they are waiting on (\`--mode info\`).`,
|
|
81
|
+
`If you are unsure, it is NOT a briefing — put it on the dashboard. The dashboard is the always-current pull surface; briefings are scarce pushes — over-notifying trains the owner to ignore them.`,
|
|
82
|
+
``,
|
|
77
83
|
`When the step is done, advance the state machine by running EXACTLY ONE report:`,
|
|
78
84
|
` ${reportCmd}`,
|
|
79
85
|
``,
|
|
80
|
-
`Reporting the outcome is what continues the loop: a running next state arrives as a fresh step, and the loop parks itself when there is no gap or it must wait. Reach the owner only through
|
|
86
|
+
`Reporting the outcome is what continues the loop: a running next state arrives as a fresh step, and the loop parks itself when there is no gap or it must wait. Reach the owner only through Ticlawk surfaces — \`ticlawk message send --target ${target}\` (chat), \`ticlawk briefing publish\` (push, per the rule above), \`ticlawk dashboard set\` (goal report); see \`SURFACES.md\`. Any owner-facing text is for the owner in their language: say what changed, why it matters, and what (if anything) they must do; never expose internal task titles, file paths, step numbers, or harness tokens. Report exactly once; do not loop inside this single turn.`,
|
|
81
87
|
`[/goal_step]`,
|
|
82
88
|
].join('\n'));
|
|
83
89
|
} else {
|
|
@@ -39,3 +39,5 @@ Use `ticlawk credential request --name <ENV_VAR>` to create the credential slot.
|
|
|
39
39
|
## Reminders
|
|
40
40
|
|
|
41
41
|
Use reminders only for external/time-based future follow-up or visible, persistent resume conditions. Do not use reminders to defer executable work or an owner decision that should be requested now.
|
|
42
|
+
|
|
43
|
+
For a fixed cadence (a daily or weekly check-in, e.g. meal-time reminders), use ONE recurring reminder, not many enumerated one-shots: `ticlawk reminder schedule ... --recur-at HH:MM --recur-tz <owner IANA tz> [--recur-weekday 1,2,3]`. It auto-advances to the next occurrence on each fire and stays active, so the cadence never runs out.
|