@iiiokojiadbi/shift 0.29.0 → 0.30.0

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/README.md CHANGED
@@ -6,7 +6,7 @@ The agent decides by itself when to **shift**. At a stage boundary it updates it
6
6
  pi install npm:@iiiokojiadbi/shift
7
7
  ```
8
8
 
9
- The extension adds a "Shift" section to the system prompt, the `shift` tool with its companions (`shift_guide`, `shift_status`, `shift_history`, `shift_setup`, `task_open`, `task_track`, `task_archive`, `doc_outline`, `docs_mentioning`), and two commands: `/shift-tasks` lists the open tasks, `/unshift` picks up the last shift in a fresh session. It hints a shift as the history grows.
9
+ The extension adds a "Shift" section to the system prompt, the `shift` tool with its companions (`shift_guide`, `shift_status`, `shift_history`, `shift_setup`, `task_open`, `task_track`, `task_archive`, `doc_outline`, `docs_mentioning`), and three commands: `/shift` asks the agent to shift now, `/shift-tasks` lists the open tasks, `/unshift` picks up the last shift in a fresh session. It hints a shift as the history grows.
10
10
 
11
11
  The records live in the project's `.shift/` folder and stay out of its git unless `commit = true` in `.shift/settings.toml`.
12
12
 
package/core/layout.ts CHANGED
@@ -26,6 +26,8 @@ export const RESUME_COMMAND = 'unshift'
26
26
 
27
27
  export const TASKS_COMMAND = 'shift-tasks'
28
28
 
29
+ export const SHIFT_COMMAND = 'shift'
30
+
29
31
  // The board is the state of the work; past this it has turned into a diary.
30
32
  export const BOARD_MAX_LINES = 150
31
33
 
@@ -18,8 +18,10 @@ import {
18
18
  OWNER,
19
19
  RESUME_COMMAND,
20
20
  SETTINGS,
21
+ SHIFT_COMMAND,
21
22
  TASK_LIST,
22
23
  TASKS,
24
+ TOOL,
23
25
  TRACK_TOOL,
24
26
  } from '../layout'
25
27
  import { frontmatter } from '../markdown'
@@ -225,6 +227,10 @@ export function resumePrompt(letter: string, back: HandedBack): string {
225
227
  // What starts the turn after /unshift when the owner wrote nothing with it: the letter is already in the history.
226
228
  export const RESUME_GO = `<${MOD} note="from the mod after /${RESUME_COMMAND}">Pick up from the shift above: continue from "${NEXT}".</${MOD}>`
227
229
 
230
+ // The owner's /shift: their word to shift now, the first hint or not, with what they typed after the command.
231
+ export const SHIFT_NOW = (words: string) =>
232
+ `<${MOD} note="from the owner's /${SHIFT_COMMAND}">The owner asks you to shift now, whether a hint has come or not. Bring the step in hand to a point the letter can name, keep your records, write the letter and call ${TOOL}; choose after as the work needs.${words === '' ? '' : ` The owner's words: ${words}`}</${MOD}>`
233
+
228
234
  // How the turn ends once a shift is accepted. The owner reads the turn's last message, not the letter or the records:
229
235
  // with `wait` it is the answer they come back to.
230
236
  const TURN_END: Record<ShiftAfter, string> = {
@@ -36,6 +36,8 @@ export const SETUP_DESCRIPTION =
36
36
 
37
37
  export const TASKS_DESCRIPTION = 'The open tasks and the items of those in progress, read from .shift/; the agent is not asked'
38
38
 
39
+ export const SHIFT_NOW_DESCRIPTION = 'Ask the agent to shift now; words typed after it go to the agent with the ask'
40
+
39
41
  export const RESUME_DESCRIPTION = 'Pick up the work from the last shift: the letter, the board and the tasks in progress go to the agent'
40
42
 
41
43
  export const SETUP_SCHEMA = { type: 'object', properties: {} }
package/index.ts CHANGED
@@ -23,6 +23,9 @@ import {
23
23
  RESUME_DESCRIPTION,
24
24
  resumeShift,
25
25
  SETTINGS,
26
+ SHIFT_COMMAND,
27
+ SHIFT_NOW,
28
+ SHIFT_NOW_DESCRIPTION,
26
29
  SOURCES,
27
30
  sessionDoctrine,
28
31
  sessionFiles,
@@ -90,6 +93,15 @@ export default function shift(pi: ExtensionAPI): void {
90
93
  handler: async (_args, ctx) => ctx.ui.notify(await tasksView(await projectAt(ctx.cwd)), 'info'),
91
94
  })
92
95
 
96
+ pi.registerCommand(SHIFT_COMMAND, {
97
+ description: SHIFT_NOW_DESCRIPTION,
98
+ handler: async (args, ctx) => {
99
+ if (!enabled) return ctx.ui.notify(`${MOD} is off in this project: ${SETTINGS} has enabled = false.`, 'info')
100
+ // Typed mid-run, it waits for the run to end, as Claude Code holds a command until the turn is over.
101
+ pi.sendUserMessage(SHIFT_NOW(args.trim()), ctx.isIdle() ? undefined : { deliverAs: 'followUp' })
102
+ },
103
+ })
104
+
93
105
  pi.registerCommand(RESUME_COMMAND, {
94
106
  description: RESUME_DESCRIPTION,
95
107
  // The owner's words typed with the command go after the letter, as their own message that starts the turn.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iiiokojiadbi/shift",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "The agent decides by itself when to shift: it keeps a work board and task folders, writes a letter to itself, and continues from where it stopped.",
5
5
  "license": "MIT",
6
6
  "type": "module",