flycal-cli 0.7.3 → 0.7.7
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.
- checksums.yaml +4 -4
- data/README.md +105 -227
- data/lib/flycal_cli/calendar_service.rb +2 -5
- data/lib/flycal_cli/cli.rb +74 -148
- data/lib/flycal_cli/description_query.rb +32 -0
- data/lib/flycal_cli/mock/calendar_service.rb +43 -0
- data/lib/flycal_cli/mock/config.rb +171 -0
- data/lib/flycal_cli/mock/event_generator.rb +71 -0
- data/lib/flycal_cli/mock.rb +10 -0
- data/lib/flycal_cli/pipeline/aggregator.rb +229 -0
- data/lib/flycal_cli/pipeline/json_renderer.rb +142 -0
- data/lib/flycal_cli/pipeline/params.rb +46 -0
- data/lib/flycal_cli/pipeline/renderer.rb +27 -0
- data/lib/flycal_cli/pipeline/retriever.rb +72 -0
- data/lib/flycal_cli/pipeline/search_pipeline.rb +18 -0
- data/lib/flycal_cli/pipeline/text_renderer.rb +133 -0
- data/lib/flycal_cli/pipeline.rb +14 -0
- data/lib/flycal_cli/version.rb +1 -1
- data/lib/flycal_cli.rb +3 -0
- data/mcp/README.md +48 -9
- data/mcp/tools.json +322 -53
- data/mockTemplates/mock1.json +11 -0
- data/mocks/mock1.json +11 -0
- metadata +16 -1
data/lib/flycal_cli.rb
CHANGED
|
@@ -7,9 +7,12 @@ require "flycal_cli/auth"
|
|
|
7
7
|
require "flycal_cli/duration_parser"
|
|
8
8
|
require "flycal_cli/date_time_parser"
|
|
9
9
|
require "flycal_cli/clipboard"
|
|
10
|
+
require "flycal_cli/description_query"
|
|
10
11
|
require "flycal_cli/calendar_service"
|
|
11
12
|
require "flycal_cli/slot_finder"
|
|
12
13
|
require "flycal_cli/slot_formatter"
|
|
14
|
+
require "flycal_cli/mock"
|
|
15
|
+
require "flycal_cli/pipeline"
|
|
13
16
|
require "flycal_cli/cli"
|
|
14
17
|
|
|
15
18
|
module FlycalCli
|
data/mcp/README.md
CHANGED
|
@@ -1,29 +1,68 @@
|
|
|
1
1
|
# flycal MCP catalog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Machine-readable description of **flycal-cli** for MCP servers.
|
|
4
4
|
|
|
5
5
|
## File
|
|
6
6
|
|
|
7
|
-
- [`tools.json`](./tools.json) —
|
|
7
|
+
- [`tools.json`](./tools.json) — full catalog:
|
|
8
|
+
- `global_options` / `shared_formats` — shared `--locale`, date and duration formats
|
|
9
|
+
- `config.keys` — `~/.flycal/config.yml` keys used by the CLI
|
|
10
|
+
- `tools[].parameters` — human-readable parameter docs (cli flags, defaults, examples)
|
|
11
|
+
- `tools[].inputSchema` — JSON Schema for MCP tool registration
|
|
12
|
+
- `command.option_map` — how to build argv from tool arguments
|
|
8
13
|
|
|
9
14
|
## How an MCP server can use it
|
|
10
15
|
|
|
11
16
|
1. Load `tools.json` at startup.
|
|
12
|
-
2. Register each entry in `tools` with your MCP SDK
|
|
13
|
-
3. On tool call, build
|
|
17
|
+
2. Register each entry in `tools` with your MCP SDK using `name`, `description`, and `inputSchema`.
|
|
18
|
+
3. On tool call, build argv:
|
|
14
19
|
- static tools → `command.argv`
|
|
15
|
-
- parameterized tools → start from `command.argv_template`, then
|
|
20
|
+
- parameterized tools → start from `command.argv_template`, then for each provided arg append `command.option_map[arg]`
|
|
16
21
|
- if `locale` is set → append `--locale <value>`
|
|
17
|
-
4. Run `flycal` as a subprocess and return stdout as text
|
|
18
|
-
5. Skip
|
|
22
|
+
4. Run `flycal` as a subprocess and return stdout as text.
|
|
23
|
+
5. Skip tools with `"interactive": true` (`flycal_login`, `flycal_config`) unless a TTY is available.
|
|
24
|
+
|
|
25
|
+
## Parameters cheat sheet
|
|
26
|
+
|
|
27
|
+
### Global
|
|
28
|
+
|
|
29
|
+
| Param | CLI | Values |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `locale` | `--locale` | `en`, `it` |
|
|
32
|
+
|
|
33
|
+
### `flycal_search`
|
|
34
|
+
|
|
35
|
+
| Param | CLI | Default | Notes |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| `calendar` | `--calendar` / `-c` | `calendar_default` | name or ID |
|
|
38
|
+
| `from` | `--from` / `-f` | today midnight | absolute or relative date |
|
|
39
|
+
| `to` | `--to` / `-t` | +30 days 23:59 | ignored if `in` set |
|
|
40
|
+
| `in` | `--in` / `-i` | — | duration from `from`, overrides `to` |
|
|
41
|
+
| `description` | `--description` / `-d` | — | contains filter |
|
|
42
|
+
| `locale` | `--locale` | config/`en` | |
|
|
43
|
+
|
|
44
|
+
### `flycal_slots`
|
|
45
|
+
|
|
46
|
+
| Param | CLI | Default | Notes |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| `duration` | `--duration` | `45min` (config) | min free-range length |
|
|
49
|
+
| `from` | `--from` / `-f` | `now` (config) | absolute or relative (`monday`, `next monday`, …) |
|
|
50
|
+
| `in` | `--in` / `-i` | `1 week` | window from `--from` |
|
|
51
|
+
| `template` | `--template` / `-T` | first template (`work`) | from `slots.templates` |
|
|
52
|
+
| `calendar` | `--calendar` / `-c` | — | fallback if `exclude_calendars` empty |
|
|
53
|
+
| `locale` | `--locale` | config/`en` | |
|
|
54
|
+
|
|
55
|
+
### Relative `--from` examples
|
|
56
|
+
|
|
57
|
+
`now`, `today`/`oggi`, `tomorrow`/`domani`, `monday`/`lunedi`, `next monday`/`prossimo lunedi`, `last friday`/`scorso venerdi`
|
|
19
58
|
|
|
20
59
|
## Suggested tools to expose
|
|
21
60
|
|
|
22
61
|
| MCP tool | CLI | Notes |
|
|
23
62
|
|---|---|---|
|
|
24
63
|
| `flycal_search` | `flycal search ...` | Primary read tool |
|
|
25
|
-
| `flycal_slots` | `flycal slots
|
|
64
|
+
| `flycal_slots` | `flycal slots ...` | Free slots |
|
|
26
65
|
| `flycal_calendars` | `flycal calendars` | List name + id |
|
|
27
66
|
| `flycal_version` | `flycal version` | Health / version check |
|
|
28
67
|
|
|
29
|
-
Interactive / side-effect tools (`login`, `logout`, `config`, `update`) are documented
|
|
68
|
+
Interactive / side-effect tools (`login`, `logout`, `config`, `update`) are documented but usually better left to a user terminal.
|