p2-i Studio for VS Code
Read and extend ZIA skills and MILO workflows of p2-i OS from VS Code. Everything runs as you. Every change is a
proposal first: you see the diff, confirm, and a new version is created. You can always go back to an older version.
Install
- In p2-i OS open Tools, Developer (an administrator must give you the Developer tool) and download the extension
(
p2i-studio-0.1.0.vsix).
- In VS Code open Extensions, the
... menu, Install from VSIX.
- A p2-i Studio icon appears in the Activity Bar.
Connect
- In Tools, Developer download your connection file (
<Installation> - <name>.p2studio).
- In VS Code run p2-i Studio: Open connection file (or double-click the file / File, Open File). That is all: the file
holds a one-time sign-in code, VS Code exchanges it for a key kept in Secret Storage and shows
"Connected to as ". No password, no key to copy.
- If the code was already used or is older than 15 minutes, the browser opens the portal page Connect VS Code to
?. Click Connect and the browser hands a new code back to VS Code (
vscode:// link, checked with a
random state). Works in remote (SSH) windows too: the extension runs on your PC.
The key is named "VS Code - " and can be revoked in Tools, Developer (revoking the file revokes the key).
The command Enter developer key is still there, hidden in the command palette, as a fallback.
Plain http:// is accepted only for private addresses (10.x, 172.16-31.x, 192.168.x, localhost, *.internal); everything
else must be https:// (setting p2iStudio.allowHttp overrides this).
Use
- Tree view (Activity Bar, p2-i Studio): ZIA skills by group (lock = cannot be extended, check = extension active),
Workflows with their versions, pending Proposals. Click a skill to read it (the base text is read-only).
- Extend a skill: the
+ button on a skill opens a draft prefilled with the active extension. Edit it, then press
Propose (or Preview to see the effective text). A diff opens titled <title> (proposal) with Apply and
Discard. Apply asks for a confirmation, then offers Open in p2-i OS.
- Workflows: open a workflow to edit its spec as JSON, Validate (problems appear in the Problems panel) and
Propose change. New workflow asks for a name and a description; new workflows are created disabled.
- Chat: the Chat view in the p2-i Studio container, or
@p2i in VS Code Chat. Select a skill in the tree to give
the chat context. The assistant can only propose; you press Apply.
Develop
npm ci
npm run lint
npm test # unit tests + Extension Host integration tests against the mock server
npm run mock # mock p2-i Studio server on http://127.0.0.1:8481, key p2dk_mockkey
npm run package # p2i-studio-0.1.0.vsix
test/mock-server.ts implements the Studio REST contract (token, skills, workflows, proposals, NDJSON chat).