@dev-mainsequence/codex-plugin 0.0.0-stage → 0.3.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.
Files changed (50) hide show
  1. package/.codex-plugin/plugin.json +21 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +13 -0
  4. package/README.md +143 -2
  5. package/assets/mainsequence-icon.png +0 -0
  6. package/assets/mainsequence-icon.svg +454 -0
  7. package/build-info.json +10 -0
  8. package/dist/hosts/codex.js +62 -0
  9. package/dist/hosts/codexPresentation.js +164 -0
  10. package/dist/package.json +1 -0
  11. package/dist/runner.js +71 -0
  12. package/dist/vendor/devtools/LICENSE +21 -0
  13. package/dist/vendor/devtools/NOTICE +12 -0
  14. package/dist/vendor/devtools/index.js +68 -0
  15. package/dist/vendor/devtools/package.json +5 -0
  16. package/dist/vendor/devtools/shared/actions.js +156 -0
  17. package/dist/vendor/devtools/shared/agentReadiness.js +71 -0
  18. package/dist/vendor/devtools/shared/agents.js +236 -0
  19. package/dist/vendor/devtools/shared/arguments.js +142 -0
  20. package/dist/vendor/devtools/shared/cli.js +144 -0
  21. package/dist/vendor/devtools/shared/config.js +64 -0
  22. package/dist/vendor/devtools/shared/devcontainerJsonc.js +153 -0
  23. package/dist/vendor/devtools/shared/envfile.js +128 -0
  24. package/dist/vendor/devtools/shared/hostSession.js +324 -0
  25. package/dist/vendor/devtools/shared/machineSession.js +338 -0
  26. package/dist/vendor/devtools/shared/mcp.js +329 -0
  27. package/dist/vendor/devtools/shared/mcpTransport.js +164 -0
  28. package/dist/vendor/devtools/shared/models.js +12 -0
  29. package/dist/vendor/devtools/shared/organizationProjectWorkspace.js +300 -0
  30. package/dist/vendor/devtools/shared/organizationProjects.js +145 -0
  31. package/dist/vendor/devtools/shared/process.js +61 -0
  32. package/dist/vendor/devtools/shared/projectOperations.js +279 -0
  33. package/dist/vendor/devtools/shared/projects.js +390 -0
  34. package/dist/vendor/devtools/shared/pythonProjectStatus.js +86 -0
  35. package/dist/vendor/devtools/shared/pythonSdkStatus.js +26 -0
  36. package/dist/vendor/devtools/shared/repositories.js +215 -0
  37. package/dist/vendor/devtools/shared/repositoryClient.js +108 -0
  38. package/dist/vendor/devtools/shared/repositoryIdentity.js +116 -0
  39. package/dist/vendor/devtools/shared/repositoryModels.js +72 -0
  40. package/dist/vendor/devtools/shared/session.js +444 -0
  41. package/docs/adr/0002-conversational-project-mcp-client.md +59 -0
  42. package/docs/codex-verification.md +124 -0
  43. package/docs/conversational-mcp.md +54 -0
  44. package/hooks/hooks.json +17 -0
  45. package/package.json +46 -4
  46. package/skills/mainsequence-mcp/SKILL.md +40 -0
  47. package/skills/ms/SKILL.md +8 -0
  48. package/skills/ms/agents/openai.yaml +7 -0
  49. package/skills/ms/assets/mainsequence-icon.png +0 -0
  50. package/skills/ms/assets/mainsequence-icon.svg +454 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "mainsequence",
3
+ "version": "0.3.0",
4
+ "description": "Use MainSequence project MCPs from conversation and run explicit developer commands with the bundled runner.",
5
+ "author": {
6
+ "name": "MainSequence"
7
+ },
8
+ "license": "MIT",
9
+ "hooks": "./hooks/hooks.json",
10
+ "skills": "./skills/",
11
+ "interface": {
12
+ "displayName": "MainSequence Developer Tools",
13
+ "shortDescription": "Use project MCPs and run MainSequence developer commands.",
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
+ }
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,144 @@
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
+ The `mainsequence` plugin registers the `ms` slash-menu entry in Codex and executes its
4
+ commands with a trusted `UserPromptSubmit` hook before inference: login, session status,
5
+ repositories, project status, dependency sync, SDK updates and more, with readable results
6
+ and no model call. Its `mainsequence-mcp` skill lets Codex discover MainSequence project
7
+ MCPs in conversation, remember a selection and use that project's tools through a bundled
8
+ MCP client.
9
+
10
+ Version **0.3.0** is the first release from this repository. Until devtools 0.2.8 the plugin
11
+ was built and published from
12
+ [mainsequence-devtools](https://github.com/mainsequence-sdk/mainsequence-devtools) under the
13
+ name `mainsequence-devtools` ([ADR 0003 there](https://github.com/mainsequence-sdk/mainsequence-devtools/blob/main/docs/adr/0003-codex-plugin-extraction.md)).
14
+ The shared implementation is still that package; this repository owns the hook adapter, the
15
+ presentation layer, the manifests, skills and icons, the host checks and the releases.
16
+
17
+ ## Install
18
+
19
+ The marketplace stays where people added it, in the devtools repository:
20
+
21
+ ```sh
22
+ codex plugin marketplace add mainsequence-sdk/mainsequence-devtools
23
+ codex plugin add mainsequence@mainsequence
24
+ ```
25
+
26
+ Codex installs the published npm package `@dev-mainsequence/codex-plugin` without running
27
+ lifecycle scripts; the archive already contains the compiled runner and the pinned devtools
28
+ package. Node 22 or newer is required. Review and trust the plugin's hook before use
29
+ (`/hooks` in the CLI, or the hook prompt in the desktop app): installation does not trust
30
+ hooks, and an untrusted hook cannot intercept `/ms`. Then start a new chat, or toggle
31
+ MainSequence off and on in the desktop Plugins settings to hot-reload an existing chat.
32
+
33
+ ### Upgrading from `mainsequence-devtools`
34
+
35
+ The plugin was renamed, and Codex identifies a plugin by its marketplace entry name, so the
36
+ installed `mainsequence-devtools@mainsequence` is not updated in place. Refresh the
37
+ marketplace, install the new entry, trust its hook, then remove the old plugin so that only
38
+ one hook answers `/ms`:
39
+
40
+ ```sh
41
+ codex plugin marketplace upgrade mainsequence
42
+ codex plugin add mainsequence@mainsequence
43
+ codex plugin remove mainsequence-devtools@mainsequence
44
+ ```
45
+
46
+ Your MainSequence login (the shared machine session) and saved MCP connections
47
+ (`mcp-connections.json` beside the CLI configuration) are not stored by the plugin, so
48
+ nothing needs migrating. The exact behaviour of the installed host during this change is
49
+ recorded in [the verification document](docs/codex-verification.md).
50
+
51
+ ### A local build
52
+
53
+ ```sh
54
+ npm run build
55
+ codex plugin marketplace add /absolute/path/to/mainsequence-codex-plugin/artifacts/local-marketplace
56
+ codex plugin add mainsequence@mainsequence-local
57
+ ```
58
+
59
+ The local catalog loads the built artifact in `codex/`; the installed plugin runs from
60
+ Codex's cache. `npm run pack:codex` also writes a standalone archive of that artifact.
61
+
62
+ ## Use
63
+
64
+ In Codex desktop, type `/ms` and **select `ms` from the slash menu**, then append the
65
+ arguments and submit:
66
+
67
+ ```text
68
+ /ms --help
69
+ /ms login --backend https://api.main-sequence.app
70
+ /ms status
71
+ /ms sync
72
+ ```
73
+
74
+ Selection inserts a native skill mention. The hook accepts that mention only when it
75
+ references this plugin's own `skills/ms/SKILL.md`, parses the single-line arguments as data
76
+ without any shell, and blocks the turn with a readable result on success and failure, so a
77
+ handled command never reaches the model. `/ms --help --all` lists every command and
78
+ `/ms COMMAND --help` its options; `--json` exports the structured result. Ordinary prompts
79
+ pass through. Codex CLI rejects custom `/ms` input before submission; use `ms-devtools` in
80
+ a terminal there (see below).
81
+
82
+ For project MCPs, ask in conversation: "Which internal MCPs are available?", "Add
83
+ metatable-mcp", "Use it to list my tables." See
84
+ [conversational project MCP connections](docs/conversational-mcp.md) and
85
+ [ADR 0002](docs/adr/0002-conversational-project-mcp-client.md).
86
+
87
+ ## Architecture and development
88
+
89
+ Shared functionality comes from the exact `@dev-mainsequence/devtools` package API. The
90
+ build (`scripts/build-codex.cjs`) compiles `src/` to `build/`, then writes the installable
91
+ artifact to `codex/`: the manifest, hooks, skills and icons from `manifests/codex`, the
92
+ runner and hook adapter with every reachable devtools `dist` module vendored into
93
+ `dist/vendor/devtools`, and `build-info.json` with the pinned devtools version and
94
+ registry integrity. Codex's npm plugin source reads the manifest from the package root, so
95
+ the build mirrors `.codex-plugin`, `hooks`, `skills`, `assets`, `build-info.json` and the
96
+ bundled `dist` there for `npm pack`; those mirrors are ignored by Git. An installed plugin
97
+ needs neither this checkout, nor `node_modules`, nor an npm download at execution time.
98
+
99
+ `src/runner.ts` is the plugin's entry point: `dist/runner.js --codex-hook` serves the
100
+ hook, and any other invocation is the plain `ms-devtools` terminal CLI, so this package's
101
+ `bin` keeps working in a shell (`npx -p @dev-mainsequence/codex-plugin ms-devtools --help`).
102
+ `src/hosts/codex.ts` recognises `/ms` and the linked skill mention and dispatches through
103
+ devtools' exported parser and tokenizer; `src/hosts/codexPresentation.ts` renders help and
104
+ results. `tests/dependency-boundary.test.cjs` forbids private devtools imports.
105
+
106
+ ### Dependencies
107
+
108
+ `npm ci --ignore-scripts` installs the pinned devtools from the registry with the integrity
109
+ recorded in `package-lock.json`. While that version is not published yet, run
110
+
111
+ ```sh
112
+ node scripts/install-devtools.cjs /path/to/dev-mainsequence-devtools-0.3.0.tgz
113
+ ```
114
+
115
+ with the archive from `npm pack` of the devtools release branch, or without an argument to
116
+ build it from the devtools repository at `DEVTOOLS_SOURCE_REF` (default `v<pinned version>`).
117
+ Either way the archive must match the lockfile integrity, and the registry pin is not
118
+ changed (`scripts/use-local-devtools.cjs`). CI does the same until the version is
119
+ published. After publication, confirm that `npm view @dev-mainsequence/devtools@0.3.0
120
+ dist.integrity` equals the lockfile entry before tagging a release; if the registry archive
121
+ differs, update the lockfile and rebuild so `build-info.json` records the published
122
+ integrity.
123
+
124
+ ### Verification and release
125
+
126
+ ```sh
127
+ npm run release:check
128
+ ```
129
+
130
+ type-checks, builds, runs the Node tests (hook, presentation, packaging and dependency
131
+ boundary), checks release metadata, packs the standalone artifact and the npm archive, and
132
+ verifies the npm archive as Codex installs it. With a built plugin installed and trusted in
133
+ a Codex host, `npm run verify:codex` runs real app-server turns through a counted offline
134
+ model fixture, and `npm run verify:codex:reload` checks the existing-chat reload behaviour
135
+ in a temporary Codex home. Set `MAINSEQUENCE_CODEX_BINARY` when the Codex CLI is not on
136
+ `PATH`, `CODEX_HOME` to check an isolated home, and `MAINSEQUENCE_CODEX_PLUGIN_ID` for a
137
+ plugin installed from another marketplace. Results are recorded in
138
+ [docs/codex-verification.md](docs/codex-verification.md).
139
+
140
+ A `v<version>` tag runs the same checks from the published devtools archive and publishes
141
+ the verified npm archive with provenance through npm trusted publishing (repository
142
+ `mainsequence-sdk/mainsequence-codex-plugin`, workflow `release.yml`, environment `npm`).
143
+ Published versions are immutable. After publishing, point the marketplace entry in the
144
+ devtools repository at the new version.
Binary file