insightfactory-cli 1.1.1.dev25__tar.gz → 1.1.2.dev29__tar.gz
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.
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/CHANGELOG.md +31 -2
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/CLAUDE.md +10 -6
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/PKG-INFO +84 -14
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/README.md +83 -13
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/pyproject.toml +1 -1
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/mcp.py +17 -2
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/config.py +16 -2
- insightfactory_cli-1.1.2.dev29/src/if_cli/router/content.py +298 -0
- insightfactory_cli-1.1.2.dev29/src/if_cli/router/server.py +571 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/router/upstream.py +69 -7
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_config.py +30 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_mcp_command.py +210 -1
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_release_tools.py +136 -8
- insightfactory_cli-1.1.2.dev29/tests/test_router_content.py +310 -0
- insightfactory_cli-1.1.2.dev29/tests/test_router_resources.py +436 -0
- insightfactory_cli-1.1.2.dev29/tools/check_release.py +163 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/uv.lock +1 -1
- insightfactory_cli-1.1.1.dev25/src/if_cli/router/server.py +0 -281
- insightfactory_cli-1.1.1.dev25/tools/check_release.py +0 -79
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/.github/workflows/ci.yml +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/.github/workflows/claude.yml +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/.github/workflows/release.yml +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/.gitignore +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/.python-version +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/AGENTS.md +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/LICENSE +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/__init__.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/__main__.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/assets/__init__.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/assets/insightfactoryai-logo.svg +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/cache.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/callback_page.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/cli.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/colour.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/__init__.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/api.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/config.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/login.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/logout.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/profiles.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/set_token.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/token.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/constants.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/http.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/main.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/oauth.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/router/__init__.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/router/catalog.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/router/log.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/router/policy.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/runtime.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/__init__.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/cache_writer.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/conftest.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/helpers.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/servers.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_api.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_api_command.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_cache.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_cli.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_config_command.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_login.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_oauth.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_oauth_flow.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_oauth_force_refresh.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_profiles.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_programmatic_api.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_router_catalog.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_router_policy.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_router_server.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_router_upstream.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_runtime.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_set_token.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tests/test_token.py +0 -0
- {insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/tools/release_notes.py +0 -0
|
@@ -7,8 +7,37 @@ project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
The release job reads the section whose heading matches the version in
|
|
9
9
|
`pyproject.toml` and makes it the body of the GitHub Release. CI holds both ends of
|
|
10
|
-
that:
|
|
11
|
-
|
|
10
|
+
that: every PR into `develop` must add an entry here, and a tag whose version has no
|
|
11
|
+
section fails rather than releasing an empty page. The version only moves when the
|
|
12
|
+
last one has been released, so a cycle's PRs share a section.
|
|
13
|
+
|
|
14
|
+
## 1.1.2
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- The MCP router serves resources, prompts and completion as well as tools, so a
|
|
19
|
+
factory's hosted skills reach a client through `if-cli mcp` instead of only through a
|
|
20
|
+
direct connection. `skill://` bodies come from the `--catalog` environment as
|
|
21
|
+
published; a resource template is republished with an `environment` variable added so
|
|
22
|
+
the client picks the factory when it expands the URI; a prompt gains the same required
|
|
23
|
+
`environment` argument a tool gets, plus a line naming the chosen environment in the
|
|
24
|
+
rendered text.
|
|
25
|
+
- `--skills` / `--no-skills`, and `skills = true` in a `[factory <name>]` section,
|
|
26
|
+
advertise the experimental skills extension (SEP-2640). Off by default: the handshake
|
|
27
|
+
is answered before any factory has been reached, so the claim is made only when
|
|
28
|
+
someone asks for it. The resources themselves are served either way, and only a
|
|
29
|
+
client on protocol 2026-07-28 or later can see the advertisement, since the
|
|
30
|
+
`initialize` handshake predates `capabilities.extensions`.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- `release-guard` asks every PR into `develop` for a `CHANGELOG.md` entry, and asks
|
|
35
|
+
for a version bump only when `develop` is still on the version `main` is on. One
|
|
36
|
+
bump opens a release cycle and the PRs after it add to the section it opened,
|
|
37
|
+
rather than each minting a version that is never tagged.
|
|
38
|
+
- The guard now measures a version against `main` as well as the base branch. A bump
|
|
39
|
+
has to land above the released version, not merely above the base, and a PR into an
|
|
40
|
+
open cycle has to add a line rather than reword one.
|
|
12
41
|
|
|
13
42
|
## 1.1.1
|
|
14
43
|
|
|
@@ -34,9 +34,13 @@ uv run ty check
|
|
|
34
34
|
match `pyproject.toml`. Pushing `develop` publishes a `.dev{run_number}`
|
|
35
35
|
pre-release. Creating the release tag is a deliberate human act — do not create
|
|
36
36
|
or push one unless asked to cut a release.
|
|
37
|
-
- **Every PR into `develop`
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
- **Every PR into `develop` adds a `CHANGELOG.md` entry**, in the Added/Changed/Fixed
|
|
38
|
+
group that fits. For internal-only work (tests, CI, a refactor nothing observes) a
|
|
39
|
+
one-line entry saying so is enough. The section becomes the body of that version's
|
|
40
|
+
GitHub Release.
|
|
41
|
+
- **Raise `version` in `pyproject.toml` only when `develop` is on the same version as
|
|
42
|
+
`main`.** That version is released, so a new entry under it would describe a change
|
|
43
|
+
it does not contain: bump, and open a section for the new version. While `develop`
|
|
44
|
+
is ahead of `main` the cycle is open and PRs add to the section already there. A PR
|
|
45
|
+
into `main` always raises the version. The `release-guard` job runs
|
|
46
|
+
`tools/check_release.py` and fails the PR otherwise.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: insightfactory-cli
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2.dev29
|
|
4
4
|
Summary: Profile-based authentication CLI for the InsightFactory Interfaces API
|
|
5
5
|
Project-URL: Homepage, https://insightfactory.ai
|
|
6
6
|
Author-email: "insightfactory.ai Support" <support@insightfactory.ai>
|
|
@@ -255,9 +255,10 @@ tst = example-tst
|
|
|
255
255
|
writable = dev
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
Every key except `writable` and `
|
|
259
|
-
order is the environment order. `writable` is a comma-separated list of codes (default
|
|
260
|
-
none); `catalog` is one code (default the first environment)
|
|
258
|
+
Every key except `writable`, `catalog` and `skills` is `<environment code> = <profile name>`;
|
|
259
|
+
file order is the environment order. `writable` is a comma-separated list of codes (default
|
|
260
|
+
none); `catalog` is one code (default the first environment); `skills` is `true` or `false`
|
|
261
|
+
(default false). Then:
|
|
261
262
|
|
|
262
263
|
```bash
|
|
263
264
|
uv tool install 'insightfactory-cli[mcp]'
|
|
@@ -290,6 +291,7 @@ passed at all, replace the section's value outright, and `--allow-tool` is alway
|
|
|
290
291
|
| `--read-only` | Forces every environment read-only, overriding both the section's `writable` and any `--writable`. Cannot be combined with `--writable`. |
|
|
291
292
|
| `--catalog CODE` (default: the first environment) | Whose tool list is published; its schemas are the reference every environment is checked against. |
|
|
292
293
|
| `--allow-tool NAME` (repeatable) | Extra tool names treated as read-only, beyond the shipped list. |
|
|
294
|
+
| `--skills` / `--no-skills` | Whether to advertise the experimental skills extension. Off unless the section says `skills = true` or `--skills` is passed. The two cannot be combined. |
|
|
293
295
|
| `--timeout SECONDS` (default `120`) | Per upstream request; higher than the `api` command's default because some tools are slow. |
|
|
294
296
|
|
|
295
297
|
`mcp`'s `--timeout` does not read `INSIGHTFACTORY_REQUEST_TIMEOUT`: it parses the flag with
|
|
@@ -304,6 +306,62 @@ Passing dev-only writes to production means changing an argument value, not
|
|
|
304
306
|
connecting to a different server, so keep `--writable` scoped to the
|
|
305
307
|
environments meant to be written by hand.
|
|
306
308
|
|
|
309
|
+
### Resources, prompts and completion
|
|
310
|
+
|
|
311
|
+
Resources and prompts are not merged across environments the way tools are, because
|
|
312
|
+
a factory's non-tool content splits in two.
|
|
313
|
+
|
|
314
|
+
`skill://` bodies are documentation that belongs to a release, identical on every
|
|
315
|
+
environment running it, and they cross-reference each other by bare URI. So they are
|
|
316
|
+
served from the `--catalog` environment exactly as published. Rewriting those URIs to
|
|
317
|
+
carry an environment would leave every link inside them pointing at nothing.
|
|
318
|
+
|
|
319
|
+
A resource template is the other half: `if://task-config-schemas/{taskType}` resolves
|
|
320
|
+
to one factory's own activity catalogue, not to a shared document. The router
|
|
321
|
+
republishes each template with its own variable appended, so the client chooses the
|
|
322
|
+
environment when it expands the URI:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
if://task-config-schemas/{taskType}{?environment}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
A template that already opens a query gets `{&environment}` instead, and one that
|
|
329
|
+
ends in a fragment gets the variable in front of it, because a `?` after a `#` is an
|
|
330
|
+
ordinary character rather than a query. A template that already declares an
|
|
331
|
+
`environment` variable is skipped with a line on stderr, so one nonconforming item
|
|
332
|
+
does not hide the rest of the list.
|
|
333
|
+
|
|
334
|
+
Reading a URI with no `?environment=` is answered by the catalogue environment,
|
|
335
|
+
unless the URI could be an expansion of a published template, which is refused
|
|
336
|
+
naming the codes to choose from. Membership of `resources/list` is deliberately not
|
|
337
|
+
the test: a skill body may link to a sibling document the factory never advertised,
|
|
338
|
+
and such a link carries no `environment` and could not be given one.
|
|
339
|
+
`completion/complete` reads the environment from the request's context arguments,
|
|
340
|
+
then from the reference URI, and falls back to the catalogue environment for anything
|
|
341
|
+
it does not recognise, because a half-typed context value is the normal state of a
|
|
342
|
+
completion request and completion should degrade rather than fail. The router answers
|
|
343
|
+
for the `environment` variable itself rather than asking a factory about an argument
|
|
344
|
+
it has never heard of.
|
|
345
|
+
|
|
346
|
+
Prompts gain a required `environment` argument like tools. The router also prepends a
|
|
347
|
+
line to every rendered prompt naming the environment chosen, because a factory writes
|
|
348
|
+
its prompts for a client talking to one factory and they tell the model to call tools
|
|
349
|
+
without one. Prepended rather than appended, and marked `[if-cli router]`: the
|
|
350
|
+
factory's own last turn may be an assistant prefill, which a trailing user turn would
|
|
351
|
+
silently end.
|
|
352
|
+
|
|
353
|
+
`--skills` only controls the advertisement. The handshake is answered before any
|
|
354
|
+
factory has been reached, so the router cannot ask the catalogue environment whether
|
|
355
|
+
it serves skills in time to repeat the claim, and an experimental capability is not
|
|
356
|
+
worth guessing at. The `skill://` resources are served either way.
|
|
357
|
+
|
|
358
|
+
The advertisement reaches only a client on MCP protocol 2026-07-28 or later.
|
|
359
|
+
`capabilities.extensions` was added in that revision, and the `initialize` handshake
|
|
360
|
+
every current client opens with negotiates a 2025 revision whose capability schema
|
|
361
|
+
has no such field, so the SDK strips it before it reaches the wire. Against
|
|
362
|
+
`foundryaz-dev` with `--skills` on, Claude Code sees no extension and still finds
|
|
363
|
+
every skill through `resources/list`, which is how clients discover them today.
|
|
364
|
+
|
|
307
365
|
A tool the factory will not run until someone finishes a step in a browser, such
|
|
308
366
|
as linking a personal Databricks identity, comes back as a failed call naming the
|
|
309
367
|
page to visit rather than as a prompt. The router never relays the factory's
|
|
@@ -354,20 +412,32 @@ artifact, so its notes belong on that Release. A checkout with no tags falls bac
|
|
|
354
412
|
to the tagged version's section alone.
|
|
355
413
|
|
|
356
414
|
`develop` therefore carries the version the next release will use, and the
|
|
357
|
-
`release-guard` job holds it there.
|
|
358
|
-
|
|
359
|
-
`CHANGELOG.md` section. `tools/check_release.py` runs both checks and is what
|
|
360
|
-
fails the PR:
|
|
415
|
+
`release-guard` job holds it there. `tools/check_release.py` runs the checks and
|
|
416
|
+
is what fails the PR:
|
|
361
417
|
|
|
362
418
|
```bash
|
|
363
|
-
BASE=origin/develop python3 tools/check_release.py
|
|
419
|
+
BASE=origin/develop RELEASED=origin/main python3 tools/check_release.py
|
|
364
420
|
```
|
|
365
421
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
422
|
+
**Every PR into `develop` adds a `CHANGELOG.md` entry.** That is the whole point
|
|
423
|
+
of the file, and a change with no entry reaches users with no line anywhere
|
|
424
|
+
saying it happened.
|
|
425
|
+
|
|
426
|
+
**The version moves once per release cycle, not once per PR.** The first PR after
|
|
427
|
+
a release raises `version` in `pyproject.toml` and opens that version's section;
|
|
428
|
+
the rest of the cycle adds to the section it opened. The guard asks for the bump
|
|
429
|
+
only while `develop` is still on the version `main` is on, because that version
|
|
430
|
+
is released and its notes describe something your change is not in.
|
|
431
|
+
|
|
432
|
+
The comparison is against `main` rather than against the tag, which matters in
|
|
433
|
+
the window where the release PR has merged but the tag is not pushed yet. What a
|
|
434
|
+
version contains is fixed when it reaches `main`, so a change landing after that
|
|
435
|
+
belongs to the next version, whatever the tags say.
|
|
436
|
+
|
|
437
|
+
A PR into `main` always needs the bump. It carries no new entries, only the
|
|
438
|
+
version they were written under, and `main` exists to be tagged: leaving it on
|
|
439
|
+
`main`'s own version makes it un-taggable, since that version is on PyPI and any
|
|
440
|
+
other tag matches no file.
|
|
371
441
|
|
|
372
442
|
Verify and build live in the reusable workflow
|
|
373
443
|
[`if_s_insightfactory_cli.yml`](https://github.com/insightfactory-ai/if_sre_github_actions/blob/main/.github/workflows/if_s_insightfactory_cli.yml)
|
|
@@ -231,9 +231,10 @@ tst = example-tst
|
|
|
231
231
|
writable = dev
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
Every key except `writable` and `
|
|
235
|
-
order is the environment order. `writable` is a comma-separated list of codes (default
|
|
236
|
-
none); `catalog` is one code (default the first environment)
|
|
234
|
+
Every key except `writable`, `catalog` and `skills` is `<environment code> = <profile name>`;
|
|
235
|
+
file order is the environment order. `writable` is a comma-separated list of codes (default
|
|
236
|
+
none); `catalog` is one code (default the first environment); `skills` is `true` or `false`
|
|
237
|
+
(default false). Then:
|
|
237
238
|
|
|
238
239
|
```bash
|
|
239
240
|
uv tool install 'insightfactory-cli[mcp]'
|
|
@@ -266,6 +267,7 @@ passed at all, replace the section's value outright, and `--allow-tool` is alway
|
|
|
266
267
|
| `--read-only` | Forces every environment read-only, overriding both the section's `writable` and any `--writable`. Cannot be combined with `--writable`. |
|
|
267
268
|
| `--catalog CODE` (default: the first environment) | Whose tool list is published; its schemas are the reference every environment is checked against. |
|
|
268
269
|
| `--allow-tool NAME` (repeatable) | Extra tool names treated as read-only, beyond the shipped list. |
|
|
270
|
+
| `--skills` / `--no-skills` | Whether to advertise the experimental skills extension. Off unless the section says `skills = true` or `--skills` is passed. The two cannot be combined. |
|
|
269
271
|
| `--timeout SECONDS` (default `120`) | Per upstream request; higher than the `api` command's default because some tools are slow. |
|
|
270
272
|
|
|
271
273
|
`mcp`'s `--timeout` does not read `INSIGHTFACTORY_REQUEST_TIMEOUT`: it parses the flag with
|
|
@@ -280,6 +282,62 @@ Passing dev-only writes to production means changing an argument value, not
|
|
|
280
282
|
connecting to a different server, so keep `--writable` scoped to the
|
|
281
283
|
environments meant to be written by hand.
|
|
282
284
|
|
|
285
|
+
### Resources, prompts and completion
|
|
286
|
+
|
|
287
|
+
Resources and prompts are not merged across environments the way tools are, because
|
|
288
|
+
a factory's non-tool content splits in two.
|
|
289
|
+
|
|
290
|
+
`skill://` bodies are documentation that belongs to a release, identical on every
|
|
291
|
+
environment running it, and they cross-reference each other by bare URI. So they are
|
|
292
|
+
served from the `--catalog` environment exactly as published. Rewriting those URIs to
|
|
293
|
+
carry an environment would leave every link inside them pointing at nothing.
|
|
294
|
+
|
|
295
|
+
A resource template is the other half: `if://task-config-schemas/{taskType}` resolves
|
|
296
|
+
to one factory's own activity catalogue, not to a shared document. The router
|
|
297
|
+
republishes each template with its own variable appended, so the client chooses the
|
|
298
|
+
environment when it expands the URI:
|
|
299
|
+
|
|
300
|
+
```text
|
|
301
|
+
if://task-config-schemas/{taskType}{?environment}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
A template that already opens a query gets `{&environment}` instead, and one that
|
|
305
|
+
ends in a fragment gets the variable in front of it, because a `?` after a `#` is an
|
|
306
|
+
ordinary character rather than a query. A template that already declares an
|
|
307
|
+
`environment` variable is skipped with a line on stderr, so one nonconforming item
|
|
308
|
+
does not hide the rest of the list.
|
|
309
|
+
|
|
310
|
+
Reading a URI with no `?environment=` is answered by the catalogue environment,
|
|
311
|
+
unless the URI could be an expansion of a published template, which is refused
|
|
312
|
+
naming the codes to choose from. Membership of `resources/list` is deliberately not
|
|
313
|
+
the test: a skill body may link to a sibling document the factory never advertised,
|
|
314
|
+
and such a link carries no `environment` and could not be given one.
|
|
315
|
+
`completion/complete` reads the environment from the request's context arguments,
|
|
316
|
+
then from the reference URI, and falls back to the catalogue environment for anything
|
|
317
|
+
it does not recognise, because a half-typed context value is the normal state of a
|
|
318
|
+
completion request and completion should degrade rather than fail. The router answers
|
|
319
|
+
for the `environment` variable itself rather than asking a factory about an argument
|
|
320
|
+
it has never heard of.
|
|
321
|
+
|
|
322
|
+
Prompts gain a required `environment` argument like tools. The router also prepends a
|
|
323
|
+
line to every rendered prompt naming the environment chosen, because a factory writes
|
|
324
|
+
its prompts for a client talking to one factory and they tell the model to call tools
|
|
325
|
+
without one. Prepended rather than appended, and marked `[if-cli router]`: the
|
|
326
|
+
factory's own last turn may be an assistant prefill, which a trailing user turn would
|
|
327
|
+
silently end.
|
|
328
|
+
|
|
329
|
+
`--skills` only controls the advertisement. The handshake is answered before any
|
|
330
|
+
factory has been reached, so the router cannot ask the catalogue environment whether
|
|
331
|
+
it serves skills in time to repeat the claim, and an experimental capability is not
|
|
332
|
+
worth guessing at. The `skill://` resources are served either way.
|
|
333
|
+
|
|
334
|
+
The advertisement reaches only a client on MCP protocol 2026-07-28 or later.
|
|
335
|
+
`capabilities.extensions` was added in that revision, and the `initialize` handshake
|
|
336
|
+
every current client opens with negotiates a 2025 revision whose capability schema
|
|
337
|
+
has no such field, so the SDK strips it before it reaches the wire. Against
|
|
338
|
+
`foundryaz-dev` with `--skills` on, Claude Code sees no extension and still finds
|
|
339
|
+
every skill through `resources/list`, which is how clients discover them today.
|
|
340
|
+
|
|
283
341
|
A tool the factory will not run until someone finishes a step in a browser, such
|
|
284
342
|
as linking a personal Databricks identity, comes back as a failed call naming the
|
|
285
343
|
page to visit rather than as a prompt. The router never relays the factory's
|
|
@@ -330,20 +388,32 @@ artifact, so its notes belong on that Release. A checkout with no tags falls bac
|
|
|
330
388
|
to the tagged version's section alone.
|
|
331
389
|
|
|
332
390
|
`develop` therefore carries the version the next release will use, and the
|
|
333
|
-
`release-guard` job holds it there.
|
|
334
|
-
|
|
335
|
-
`CHANGELOG.md` section. `tools/check_release.py` runs both checks and is what
|
|
336
|
-
fails the PR:
|
|
391
|
+
`release-guard` job holds it there. `tools/check_release.py` runs the checks and
|
|
392
|
+
is what fails the PR:
|
|
337
393
|
|
|
338
394
|
```bash
|
|
339
|
-
BASE=origin/develop python3 tools/check_release.py
|
|
395
|
+
BASE=origin/develop RELEASED=origin/main python3 tools/check_release.py
|
|
340
396
|
```
|
|
341
397
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
398
|
+
**Every PR into `develop` adds a `CHANGELOG.md` entry.** That is the whole point
|
|
399
|
+
of the file, and a change with no entry reaches users with no line anywhere
|
|
400
|
+
saying it happened.
|
|
401
|
+
|
|
402
|
+
**The version moves once per release cycle, not once per PR.** The first PR after
|
|
403
|
+
a release raises `version` in `pyproject.toml` and opens that version's section;
|
|
404
|
+
the rest of the cycle adds to the section it opened. The guard asks for the bump
|
|
405
|
+
only while `develop` is still on the version `main` is on, because that version
|
|
406
|
+
is released and its notes describe something your change is not in.
|
|
407
|
+
|
|
408
|
+
The comparison is against `main` rather than against the tag, which matters in
|
|
409
|
+
the window where the release PR has merged but the tag is not pushed yet. What a
|
|
410
|
+
version contains is fixed when it reaches `main`, so a change landing after that
|
|
411
|
+
belongs to the next version, whatever the tags say.
|
|
412
|
+
|
|
413
|
+
A PR into `main` always needs the bump. It carries no new entries, only the
|
|
414
|
+
version they were written under, and `main` exists to be tagged: leaving it on
|
|
415
|
+
`main`'s own version makes it un-taggable, since that version is on PyPI and any
|
|
416
|
+
other tag matches no file.
|
|
347
417
|
|
|
348
418
|
Verify and build live in the reusable workflow
|
|
349
419
|
[`if_s_insightfactory_cli.yml`](https://github.com/insightfactory-ai/if_sre_github_actions/blob/main/.github/workflows/if_s_insightfactory_cli.yml)
|
{insightfactory_cli-1.1.1.dev25 → insightfactory_cli-1.1.2.dev29}/src/if_cli/commands/mcp.py
RENAMED
|
@@ -15,12 +15,15 @@ MCP_OPTIONS: Options = {
|
|
|
15
15
|
"catalog": {"type": "string"},
|
|
16
16
|
"allow-tool": {"type": "string", "repeat": True},
|
|
17
17
|
"timeout": {"type": "string", "default": "120"},
|
|
18
|
+
"skills": {"type": "boolean"},
|
|
19
|
+
"no-skills": {"type": "boolean"},
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
MCP_USAGE = (
|
|
21
23
|
"usage: if-cli mcp [FACTORY] [--env CODE=PROFILE ...]\n"
|
|
22
24
|
" [--writable CODE ... | --read-only] [--catalog CODE]\n"
|
|
23
25
|
" [--allow-tool NAME ...] [--timeout SECONDS]\n"
|
|
26
|
+
" [--skills | --no-skills]\n"
|
|
24
27
|
"\n"
|
|
25
28
|
"Runs one MCP server over stdio that fronts several factory environments: every\n"
|
|
26
29
|
"tool gets a required 'environment' argument, routed to that environment's own\n"
|
|
@@ -29,7 +32,9 @@ MCP_USAGE = (
|
|
|
29
32
|
"section. Without FACTORY, --env is required at least once. --catalog defaults\n"
|
|
30
33
|
"to the first environment; environments not passed to --writable are read-only;\n"
|
|
31
34
|
"--read-only forces every environment read-only and cannot be combined with\n"
|
|
32
|
-
"--writable
|
|
35
|
+
"--writable. --skills advertises the experimental skills extension; the\n"
|
|
36
|
+
"catalog environment's skill:// resources are served either way. It is off\n"
|
|
37
|
+
"unless the factory section says 'skills = true' or --skills is passed.\n"
|
|
33
38
|
)
|
|
34
39
|
|
|
35
40
|
MISSING_MCP_EXTRA = (
|
|
@@ -91,6 +96,9 @@ def mcp_command(argv: list[str]) -> None:
|
|
|
91
96
|
if read_only and raw_writable is not None:
|
|
92
97
|
die(f"--read-only cannot be combined with --writable\n\n{MCP_USAGE}")
|
|
93
98
|
|
|
99
|
+
if values["skills"] and values["no-skills"]:
|
|
100
|
+
die(f"--skills cannot be combined with --no-skills\n\n{MCP_USAGE}")
|
|
101
|
+
|
|
94
102
|
config = load_config()
|
|
95
103
|
|
|
96
104
|
# A dict, not a list of pairs: --env "adds or replaces that code's profile"
|
|
@@ -102,12 +110,14 @@ def mcp_command(argv: list[str]) -> None:
|
|
|
102
110
|
mappings: dict[str, str] = {}
|
|
103
111
|
writable_codes: frozenset[str] = frozenset()
|
|
104
112
|
catalog_source: str | None = None
|
|
113
|
+
skills = False
|
|
105
114
|
|
|
106
115
|
if factory_name is not None:
|
|
107
116
|
factory = parse_factory_section(config, factory_name)
|
|
108
117
|
mappings.update(factory["environments"])
|
|
109
118
|
writable_codes = factory["writable"]
|
|
110
119
|
catalog_source = factory["catalog"]
|
|
120
|
+
skills = factory["skills"]
|
|
111
121
|
|
|
112
122
|
for raw in raw_envs:
|
|
113
123
|
code, profile_name = _parse_env_mapping(raw)
|
|
@@ -125,6 +135,10 @@ def mcp_command(argv: list[str]) -> None:
|
|
|
125
135
|
writable_codes = frozenset(raw_writable)
|
|
126
136
|
if values["catalog"] is not None:
|
|
127
137
|
catalog_source = values["catalog"]
|
|
138
|
+
if values["skills"]:
|
|
139
|
+
skills = True
|
|
140
|
+
elif values["no-skills"]:
|
|
141
|
+
skills = False
|
|
128
142
|
if catalog_source is None:
|
|
129
143
|
catalog_source = codes[0]
|
|
130
144
|
|
|
@@ -153,7 +167,7 @@ def mcp_command(argv: list[str]) -> None:
|
|
|
153
167
|
f"{code}={mappings[code]} {profiles[code]['host']}{' (writable)' if code in writable_codes else ''}"
|
|
154
168
|
for code in codes
|
|
155
169
|
]
|
|
156
|
-
log(f"{label}: {'; '.join(parts)}; catalog={catalog_source}")
|
|
170
|
+
log(f"{label}: {'; '.join(parts)}; catalog={catalog_source}; skills={'on' if skills else 'off'}")
|
|
157
171
|
|
|
158
172
|
router = build_router(
|
|
159
173
|
profiles=profiles,
|
|
@@ -161,5 +175,6 @@ def mcp_command(argv: list[str]) -> None:
|
|
|
161
175
|
catalog_source=catalog_source,
|
|
162
176
|
extra_read_only=extra_read_only,
|
|
163
177
|
timeout=timeout,
|
|
178
|
+
skills=skills,
|
|
164
179
|
)
|
|
165
180
|
run_server(router)
|
|
@@ -28,10 +28,13 @@ class Factory(TypedDict):
|
|
|
28
28
|
environments: list[tuple[str, str]]
|
|
29
29
|
writable: frozenset[str]
|
|
30
30
|
catalog: str
|
|
31
|
+
skills: bool
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
FACTORY_SECTION_PREFIX = "factory "
|
|
34
|
-
FACTORY_RESERVED_KEYS = {"writable", "catalog"}
|
|
35
|
+
FACTORY_RESERVED_KEYS = {"writable", "catalog", "skills"}
|
|
36
|
+
FACTORY_TRUE = {"true", "yes", "on", "1"}
|
|
37
|
+
FACTORY_FALSE = {"false", "no", "off", "0", ""}
|
|
35
38
|
|
|
36
39
|
|
|
37
40
|
def config_dir() -> str:
|
|
@@ -217,7 +220,18 @@ def parse_factory_section(config: dict[str, dict[str, str]], name: str) -> Facto
|
|
|
217
220
|
catalog_value = section.get("catalog")
|
|
218
221
|
catalog = catalog_value.strip() if catalog_value is not None and catalog_value.strip() else codes[0]
|
|
219
222
|
|
|
220
|
-
|
|
223
|
+
skills_value = section.get("skills", "").strip().lower()
|
|
224
|
+
if skills_value not in FACTORY_TRUE and skills_value not in FACTORY_FALSE:
|
|
225
|
+
die(f"factory '{name}' in {config_file()}: skills must be true or false (found '{skills_value}')")
|
|
226
|
+
skills = skills_value in FACTORY_TRUE
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
"name": name,
|
|
230
|
+
"environments": environments,
|
|
231
|
+
"writable": writable,
|
|
232
|
+
"catalog": catalog,
|
|
233
|
+
"skills": skills,
|
|
234
|
+
}
|
|
221
235
|
|
|
222
236
|
|
|
223
237
|
def get_factory(config: dict[str, dict[str, str]], name: str) -> Factory:
|