@badliveware/pi-footer-framework 0.1.0 → 0.2.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/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@badliveware/pi-footer-framework",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Configurable footer framework extension for Pi.",
5
5
  "type": "module",
6
+ "types": "./index.ts",
6
7
  "keywords": [
7
8
  "pi-package",
8
9
  "pi-extension",
@@ -26,6 +27,8 @@
26
27
  "files": [
27
28
  "README.md",
28
29
  "LICENSE",
30
+ "assets",
31
+ "examples",
29
32
  "index.ts",
30
33
  "skills",
31
34
  "package.json"
@@ -11,6 +11,9 @@ Use this skill when a user wants footer layout changes without editing extension
11
11
  - the user asks to reduce footer clutter, spacing, or jitter
12
12
  - the user wants specific footer sections on/off
13
13
  - the user wants model/branch/PR placement tuned
14
+ - the user wants the agent to decide a footer layout
15
+ - the user wants normal TypeScript formatting logic for a footer item without writing a full Pi extension
16
+ - the user wants to show data from an extension that does not emit footer-framework items
14
17
  - the user wants default Pi footer restored quickly
15
18
 
16
19
  ## Commands Reference
@@ -24,44 +27,71 @@ Use this skill when a user wants footer layout changes without editing extension
24
27
  - `/footerfx save project` — save current settings for the current project
25
28
  - `/footerfx section <cwd|stats|context|model|branch|pr|ext> <on|off>`
26
29
  - `/footerfx item <id> <show|hide|reset>`
27
- - `/footerfx item <id> line <1|2>`
30
+ - `/footerfx item <id> line <n>`
31
+ - `/footerfx item <id> row <n>`
28
32
  - `/footerfx item <id> zone <left|right>`
29
33
  - `/footerfx item <id> order <n>`
30
34
  - `/footerfx item <id> before <other-id>` / `/footerfx item <id> after <other-id>`
31
- - `/footerfx item <id> column <n|off>`
32
- - `/footerfx anchor <line1|line2|all> <gap|left|center|right|spread>`
35
+ - `/footerfx item <id> column <n|center|middle|percent|off>`
36
+ - `/footerfx anchor <line|all> <gap|left|center|right|spread>`
37
+ - `/footerfx adapter` — list configured adapters
38
+ - `/footerfx adapter <id> pi <source-key> [label]`
39
+ - `/footerfx adapter <id> status <status-key> [label]`
40
+ - `/footerfx adapter <id> custom <custom-type> <path> [label]`
41
+ - `/footerfx adapter <id> template <template>`
42
+ - `/footerfx adapter <id> empty-template <template>`
43
+ - `/footerfx adapter <id> style <style>`
44
+ - `/footerfx adapter <id> remove`
33
45
  - `/footerfx gap <min> <max>`
34
- - `/footerfx branch-width <n>`
35
- - `/footerfx mcp-zero <hide|show>`
46
+
47
+ ## Layout Principles
48
+ - The framework owns layout and formatting.
49
+ - Compatible extensions should emit structured data/status plus optional hints; hints are advisory only.
50
+ - Built-in footer items are default adapters unless replaced by `items.<id>.render` in TS/JS config.
51
+ - Existing extensions can be adapted from Pi status entries or custom session entries without changing their source.
52
+ - Built-in Pi/session data can be adapted from `pi` sources such as `cwd`, `model`, `stats`, `context`, `branch`, `pr`, and `extensionStatuses`.
53
+ - Adapter templates use a restricted Liquid-style grammar: quoted strings are literals (`{{ "EUR" }}`), unquoted terms are variables (`{{ pi.stats.costText }}`), and filters transform/style values (`{{ value | style: "accent,bold" }}`, `{{ pi.cwd | compactPath: 48, 2 }}`, `{{ pi.branch.label | truncate: 22 }}`).
54
+ - TS/JS configs can define normal synchronous render closures on `items.<id>.render` or `adapters.<id>.render`; use this when the user wants local helper functions, normal string methods, or logic that would make a template hard to read. Render closures return strings, spans, arrays, `null`, or `undefined`; `span(text, style, { url })` preserves token-level styling for debug output.
55
+ - Style tokens are Pi theme foreground colors/background colors and text attributes: e.g. `accent`, `muted`, `dim`, `success`, `warning`, `error`, `bg:toolSuccessBg`, `bold`, `underline`, `strikethrough`.
56
+ - User/project config and explicit agent changes override built-in adapter defaults, extension hints, and adapter defaults.
57
+ - The default layout uses two lines, but items can be placed on any positive footer line.
58
+ - Do not invent arbitrary hard limits for layout line numbers or columns; terminal width is the real rendering constraint. Prefer responsive columns like `center`, `50%`, or `66%` over absolute numeric columns when the user wants resize-stable middle placement.
36
59
 
37
60
  ## Workflow
38
- 1. Read current state with `/footerfx`.
39
- 2. Apply one focused change at a time (item placement, section, anchor, gap, branch width).
40
- 3. Changes persist automatically to the user config; use `/footerfx save project` only when the user explicitly wants project-specific layout.
41
- 4. Prefer minimal-density defaults:
61
+ 1. Read current state with `/footerfx` or `footer_framework_state`.
62
+ 2. When adapting built-in or extension data, call `footer_framework_sources` first. Prefer `piSources` for Pi data, existing `extensionStatuses` for extension status text, and recent `customEntries` when status text is insufficient. Do not request tool/command/skill metadata unless troubleshooting discovery itself; use `includeTools`, `includeCommands`, `includeSkills`, or `includeDetails` only when that extra runtime metadata is directly useful.
63
+ 3. Add adapters with `footer_framework_adapter_config` for precise JSON config, or `/footerfx adapter ...` for simple status/custom-entry mappings.
64
+ 4. Use templates when the user wants portable JSON config or simple token-level styling, such as `{{ pi.cwd | compactPath: 48, 2 | style: "dim" }} {{ pi.branch.label | default: "" | truncate: 22 | style: "accent" }}`.
65
+ 5. Use `~/.pi/agent/footer-framework.config.ts` or `<project>/.pi/footer-framework.config.ts` when normal TS helper functions are clearer; commands and tools should keep writing JSON overrides rather than rewriting TS source unless the user explicitly asks.
66
+ 6. Check `footer_framework_state` or `/footerfx-debug` for template/render diagnostics after changing templates or TS render closures.
67
+ 7. Apply one focused change at a time (adapter, template/render closure, item placement, section, anchor, or gap).
68
+ 8. Changes made through commands/tools persist automatically to the user JSON config; use `/footerfx save project` only when the user explicitly wants project-specific layout.
69
+ 9. Prefer minimal-density defaults:
42
70
  - keep `cwd`, `stats`, `context`, `model`, `branch` on
43
71
  - show `pr` when relevant
44
- - hide noisy zero-state indicators (`mcp-zero hide`)
45
- 5. If the user dislikes custom-footer behavior, run `/footerfx off`.
72
+ - adapt only the extension statuses the user wants instead of relying on the generic `ext` bucket
73
+ 10. If the user dislikes custom-footer behavior, run `/footerfx off`.
46
74
 
47
75
  ## Presets
48
76
  ### Compact
49
77
  - `/footerfx anchor all left`
50
78
  - `/footerfx gap 1 8`
51
- - `/footerfx branch-width 18`
52
79
  - `/footerfx section ext off`
53
80
 
54
81
  ### Balanced
55
- - `/footerfx anchor line1 right`
56
- - `/footerfx anchor line2 right`
82
+ - `/footerfx anchor all right`
57
83
  - `/footerfx item model line 1`
58
84
  - `/footerfx item model zone right`
59
85
  - `/footerfx item model before branch`
60
86
  - `/footerfx item ext line 2`
61
87
  - `/footerfx item ext zone right`
62
88
  - `/footerfx gap 2 16`
63
- - `/footerfx branch-width 22`
64
89
  - `/footerfx section ext on`
65
90
 
91
+ ### Expanded PR focus
92
+ - `/footerfx item pr line 3`
93
+ - `/footerfx item pr zone left`
94
+ - `/footerfx anchor 3 left`
95
+
66
96
  ### Default Pi feel
67
97
  - `/footerfx off`