@dev-mainsequence/codex-plugin 0.0.0-stage → 0.4.2

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.
Files changed (57) hide show
  1. package/.codex-plugin/plugin.json +22 -0
  2. package/.mcp.json +16 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE +13 -0
  5. package/README.md +155 -2
  6. package/assets/mainsequence-icon.png +0 -0
  7. package/assets/mainsequence-icon.svg +454 -0
  8. package/build-info.json +10 -0
  9. package/dist/hosts/codex.js +62 -0
  10. package/dist/hosts/codexPresentation.js +165 -0
  11. package/dist/hosts/discovery.js +138 -0
  12. package/dist/hosts/panel/panel.html +165 -0
  13. package/dist/package.json +1 -0
  14. package/dist/panel-server.js +135 -0
  15. package/dist/runner.js +71 -0
  16. package/dist/vendor/devtools/LICENSE +21 -0
  17. package/dist/vendor/devtools/NOTICE +12 -0
  18. package/dist/vendor/devtools/index.js +72 -0
  19. package/dist/vendor/devtools/package.json +5 -0
  20. package/dist/vendor/devtools/shared/accountScope.js +19 -0
  21. package/dist/vendor/devtools/shared/actions.js +164 -0
  22. package/dist/vendor/devtools/shared/agentReadiness.js +71 -0
  23. package/dist/vendor/devtools/shared/agents.js +240 -0
  24. package/dist/vendor/devtools/shared/arguments.js +142 -0
  25. package/dist/vendor/devtools/shared/cli.js +144 -0
  26. package/dist/vendor/devtools/shared/config.js +64 -0
  27. package/dist/vendor/devtools/shared/devcontainerJsonc.js +153 -0
  28. package/dist/vendor/devtools/shared/envfile.js +128 -0
  29. package/dist/vendor/devtools/shared/environments.js +38 -0
  30. package/dist/vendor/devtools/shared/hostSession.js +324 -0
  31. package/dist/vendor/devtools/shared/machineSession.js +338 -0
  32. package/dist/vendor/devtools/shared/mcp.js +421 -0
  33. package/dist/vendor/devtools/shared/mcpTransport.js +177 -0
  34. package/dist/vendor/devtools/shared/models.js +12 -0
  35. package/dist/vendor/devtools/shared/organizationProjectWorkspace.js +300 -0
  36. package/dist/vendor/devtools/shared/organizationProjects.js +134 -0
  37. package/dist/vendor/devtools/shared/process.js +61 -0
  38. package/dist/vendor/devtools/shared/projectOperations.js +279 -0
  39. package/dist/vendor/devtools/shared/projects.js +390 -0
  40. package/dist/vendor/devtools/shared/pythonProjectStatus.js +86 -0
  41. package/dist/vendor/devtools/shared/pythonSdkStatus.js +26 -0
  42. package/dist/vendor/devtools/shared/repositories.js +215 -0
  43. package/dist/vendor/devtools/shared/repositoryClient.js +108 -0
  44. package/dist/vendor/devtools/shared/repositoryIdentity.js +116 -0
  45. package/dist/vendor/devtools/shared/repositoryModels.js +72 -0
  46. package/dist/vendor/devtools/shared/session.js +532 -0
  47. package/docs/adr/0002-conversational-project-mcp-client.md +59 -0
  48. package/docs/agents-tools-panel.md +63 -0
  49. package/docs/codex-verification.md +161 -0
  50. package/docs/conversational-mcp.md +54 -0
  51. package/hooks/hooks.json +17 -0
  52. package/package.json +50 -4
  53. package/skills/mainsequence-mcp/SKILL.md +40 -0
  54. package/skills/ms/SKILL.md +8 -0
  55. package/skills/ms/agents/openai.yaml +7 -0
  56. package/skills/ms/assets/mainsequence-icon.png +0 -0
  57. package/skills/ms/assets/mainsequence-icon.svg +454 -0
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "mainsequence",
3
+ "version": "0.4.2",
4
+ "description": "Browse MainSequence agents and project MCPs using your existing devtools session, and run developer commands.",
5
+ "author": {
6
+ "name": "MainSequence"
7
+ },
8
+ "license": "MIT",
9
+ "hooks": "./hooks/hooks.json",
10
+ "skills": "./skills/",
11
+ "interface": {
12
+ "displayName": "MainSequence",
13
+ "shortDescription": "Browse agents and tools with your existing MainSequence session.",
14
+ "developerName": "MainSequence",
15
+ "category": "Productivity",
16
+ "websiteUrl": "https://www.main-sequence.io/",
17
+ "composerIcon": "./assets/mainsequence-icon.svg",
18
+ "logo": "./assets/mainsequence-icon.svg",
19
+ "logoDark": "./assets/mainsequence-icon.svg"
20
+ },
21
+ "mcpServers": "./.mcp.json"
22
+ }
package/.mcp.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "mcpServers": {
3
+ "mainsequence": {
4
+ "command": "node",
5
+ "args": [
6
+ "./dist/panel-server.js"
7
+ ],
8
+ "cwd": ".",
9
+ "env_vars": [
10
+ "MAINSEQUENCE_ENDPOINT",
11
+ "MAINSEQUENCE_ACCESS_TOKEN",
12
+ "MAINSEQUENCE_REFRESH_TOKEN"
13
+ ]
14
+ }
15
+ }
16
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 MainSequence SDK
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,13 @@
1
+ MainSequence Codex plugin, Copyright MainSequence SDK, MIT.
2
+
3
+ Reusable MainSequence developer tooling is bundled from @dev-mainsequence/devtools.
4
+ Its license and attribution are included in dist/vendor/devtools in the published package.
5
+
6
+ The hook adapter, presentation layer, manifests, skills and host checks were extracted
7
+ from mainsequence-sdk/mainsequence-devtools 0.2.8 (ADR 0003 there), Copyright (c) 2024
8
+ MainSequence SDK, MIT license.
9
+
10
+ MainSequence brand icons are copied unchanged from the public website:
11
+ https://www.main-sequence.io/favicon.svg
12
+ https://www.main-sequence.io/favicon-192.png
13
+ Retrieved 2026-10-01. The branding belongs to MainSequence.
package/README.md CHANGED
@@ -1,3 +1,156 @@
1
- # Temporary Holding Version
1
+ # MainSequence for Codex
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This repository is the **MainSequence Codex plugin**. Its production code lives in
4
+ `src/`, its Codex manifest in `manifests/codex/`, and its installable bundle in `codex/`.
5
+
6
+ The **0.4.2 development build** provides a native Agents/Tools panel with account and
7
+ environment status, agent search, project MCP discovery, saved-connection status and read-only schema inspection.
8
+ Ask Codex to **open MainSequence**. The plugin uses the existing devtools **0.3.2** session
9
+ and APIs; devtools remains the head. See [panel behavior and validation](docs/agents-tools-panel.md).
10
+
11
+ The plugin also registers the `ms` slash-menu entry for explicit developer commands and
12
+ the `mainsequence-mcp` skill for conversational project MCP access. The independent
13
+ Claude application is unchanged.
14
+
15
+ Version 0.3.1 added saved MCP names (see [the release notes](docs/codex-verification.md)). Version 0.3.0 was the first
16
+ release from this repository. Until devtools 0.2.8 the plugin was built and published from
17
+ [mainsequence-devtools](https://github.com/mainsequence-sdk/mainsequence-devtools) under the
18
+ name `mainsequence-devtools` ([ADR 0003 there](https://github.com/mainsequence-sdk/mainsequence-devtools/blob/main/docs/adr/0003-codex-plugin-extraction.md)).
19
+ The shared implementation is still that package; this repository owns the hook adapter, the
20
+ presentation layer, the manifests, skills and icons, the host checks and the releases.
21
+
22
+ ## Install
23
+
24
+ The marketplace stays where people added it, in the devtools repository:
25
+
26
+ ```sh
27
+ codex plugin marketplace add mainsequence-sdk/mainsequence-devtools
28
+ codex plugin add mainsequence@mainsequence
29
+ ```
30
+
31
+ Codex installs the published npm package `@dev-mainsequence/codex-plugin` without running
32
+ lifecycle scripts; the archive already contains the compiled runner and the pinned devtools
33
+ package. Node 22 or newer is required. Review and trust the plugin's hook before use
34
+ (`/hooks` in the CLI, or the hook prompt in the desktop app): installation does not trust
35
+ hooks, and an untrusted hook cannot intercept `/ms`. Then start a new chat, or toggle
36
+ MainSequence off and on in the desktop Plugins settings to hot-reload an existing chat.
37
+
38
+ ### Upgrading from `mainsequence-devtools`
39
+
40
+ The plugin was renamed, and Codex identifies a plugin by its marketplace entry name, so the
41
+ installed `mainsequence-devtools@mainsequence` is not updated in place. Refresh the
42
+ marketplace, install the new entry, trust its hook, then remove the old plugin so that only
43
+ one hook answers `/ms`:
44
+
45
+ ```sh
46
+ codex plugin marketplace upgrade mainsequence
47
+ codex plugin add mainsequence@mainsequence
48
+ codex plugin remove mainsequence-devtools@mainsequence
49
+ ```
50
+
51
+ Your MainSequence login (the shared machine session) and saved MCP connections
52
+ (`mcp-connections.json` beside the CLI configuration) are not stored by the plugin, so
53
+ nothing needs migrating. The exact behaviour of the installed host during this change is
54
+ recorded in [the verification document](docs/codex-verification.md).
55
+
56
+ ### A local build
57
+
58
+ ```sh
59
+ npm run build
60
+ codex plugin marketplace add /absolute/path/to/mainsequence-codex-plugin/artifacts/local-marketplace
61
+ codex plugin add mainsequence@mainsequence-local
62
+ ```
63
+
64
+ The local catalog loads the built artifact in `codex/`; the installed plugin runs from
65
+ Codex's cache. `npm run pack:codex` also writes a standalone archive of that artifact.
66
+
67
+ ## Use
68
+
69
+ In Codex desktop, type `/ms` and **select `ms` from the slash menu**, then append the
70
+ arguments and submit:
71
+
72
+ ```text
73
+ /ms --help
74
+ /ms login --backend https://api.main-sequence.app
75
+ /ms status
76
+ /ms sync
77
+ ```
78
+
79
+ Selection inserts a native skill mention. The hook accepts that mention only when it
80
+ references this plugin's own `skills/ms/SKILL.md`, parses the single-line arguments as data
81
+ without any shell, and blocks the turn with a readable result on success and failure, so a
82
+ handled command never reaches the model. `/ms --help --all` lists every command and
83
+ `/ms COMMAND --help` its options; `--json` exports the structured result. Ordinary prompts
84
+ pass through. Codex CLI rejects custom `/ms` input before submission; use `ms-devtools` in
85
+ a terminal there (see below).
86
+
87
+ For project MCPs, ask in conversation: "Which internal MCPs are available?", "Add
88
+ metatable-mcp", "Use it to list my tables." See
89
+ [conversational project MCP connections](docs/conversational-mcp.md) and
90
+ [ADR 0002](docs/adr/0002-conversational-project-mcp-client.md).
91
+
92
+ ## Architecture and development
93
+
94
+ Shared functionality comes from the exact `@dev-mainsequence/devtools` package API. The
95
+ build (`scripts/build-codex.cjs`) compiles `src/` to `build/`, then writes the installable
96
+ artifact to `codex/`: the manifest, hooks, skills and icons from `manifests/codex`, the
97
+ runner and hook adapter with every reachable devtools `dist` module vendored into
98
+ `dist/vendor/devtools`, and `build-info.json` with the pinned devtools version and
99
+ registry integrity. Codex's npm plugin source reads the manifest from the package root, so
100
+ the build mirrors `.codex-plugin`, `hooks`, `skills`, `assets`, `build-info.json` and the
101
+ bundled `dist` there for `npm pack`; those mirrors are ignored by Git. An installed plugin
102
+ needs neither this checkout, nor `node_modules`, nor an npm download at execution time.
103
+
104
+ `src/runner.ts` is the plugin's entry point: `dist/runner.js --codex-hook` serves the
105
+ hook, and any other invocation is the plain `ms-devtools` terminal CLI, so this package's
106
+ `bin` keeps working in a shell (`npx -p @dev-mainsequence/codex-plugin ms-devtools --help`).
107
+ `src/hosts/codex.ts` recognises `/ms` and the linked skill mention and dispatches through
108
+ devtools' exported parser and tokenizer; `src/hosts/codexPresentation.ts` renders help and
109
+ results. `tests/dependency-boundary.test.cjs` forbids private devtools imports.
110
+
111
+ ### Dependencies
112
+
113
+ `npm ci --ignore-scripts` installs the pinned devtools from the registry with the integrity
114
+ recorded in `package-lock.json`. While that version is not published yet, run
115
+
116
+ ```sh
117
+ node scripts/install-devtools.cjs /path/to/dev-mainsequence-devtools-0.3.2.tgz
118
+ ```
119
+
120
+ with the archive from `npm pack` of the devtools release branch, or without an argument to
121
+ build it from the devtools repository at `DEVTOOLS_SOURCE_REF` (default `v<pinned version>`).
122
+ Either way the archive must match the lockfile integrity, and the registry pin is not
123
+ changed (`scripts/use-local-devtools.cjs`). CI does the same until the version is
124
+ published. After publication, confirm that `npm view @dev-mainsequence/devtools@0.3.2
125
+ dist.integrity` equals the lockfile entry before tagging a release; if the registry archive
126
+ differs, update the lockfile and rebuild so `build-info.json` records the published
127
+ integrity.
128
+
129
+ For a discovery upgrade, use the exact devtools archive while it is unpublished;
130
+ with build dependencies already installed,
131
+ `node scripts/use-local-devtools.cjs /path/to/dev-mainsequence-devtools-0.3.2.tgz` verifies
132
+ its integrity and stages it without changing the registry pin. Publish devtools first,
133
+ verify its registry integrity, then release the Codex plugin. No desktop activation
134
+ or authenticated live-service acceptance is implied by a successful local build.
135
+
136
+ ### Verification and release
137
+
138
+ ```sh
139
+ npm run release:check
140
+ ```
141
+
142
+ type-checks, builds, runs the Node tests (hook, presentation, packaging and dependency
143
+ boundary), checks release metadata, packs the standalone artifact and the npm archive, and
144
+ verifies the npm archive as Codex installs it. With a built plugin installed and trusted in
145
+ a Codex host, `npm run verify:codex` runs real app-server turns through a counted offline
146
+ model fixture, and `npm run verify:codex:reload` checks the existing-chat reload behaviour
147
+ in a temporary Codex home. Set `MAINSEQUENCE_CODEX_BINARY` when the Codex CLI is not on
148
+ `PATH`, `CODEX_HOME` to check an isolated home, and `MAINSEQUENCE_CODEX_PLUGIN_ID` for a
149
+ plugin installed from another marketplace. Results are recorded in
150
+ [docs/codex-verification.md](docs/codex-verification.md).
151
+
152
+ A `v<version>` tag runs the same checks from the published devtools archive and publishes
153
+ the verified npm archive with provenance through npm trusted publishing (repository
154
+ `mainsequence-sdk/mainsequence-codex-plugin`, workflow `release.yml`, environment `npm`).
155
+ Published versions are immutable. After publishing, point the marketplace entry in the
156
+ devtools repository at the new version.
Binary file