minutework 0.1.13 → 0.1.15
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.
- package/assets/claude-local/CLAUDE.md.template +29 -2
- package/assets/claude-local/skills/README.md +1 -0
- package/assets/claude-local/skills/ai-capability-defaults.md +7 -0
- package/assets/claude-local/skills/app-pack-authoring.md +9 -0
- package/assets/claude-local/skills/capability-gap-reporting.md +25 -0
- package/assets/claude-local/skills/email-ingress-and-thread-routing.md +18 -0
- package/assets/claude-local/skills/generated-workspace-architecture.md +10 -0
- package/assets/claude-local/skills/shadow-participation-and-guest-threads.md +18 -0
- package/assets/claude-local/skills/shell-architecture.md +58 -0
- package/assets/templates/fastapi-sidecar/template.json +1 -1
- package/dist/init.js +6 -0
- package/dist/init.js.map +1 -1
- package/dist/workspace-bootstrap.d.ts +12 -0
- package/dist/workspace-bootstrap.js +102 -0
- package/dist/workspace-bootstrap.js.map +1 -0
- package/package.json +3 -3
|
@@ -13,6 +13,9 @@ Read these exported skills before making MinuteWork-specific architecture
|
|
|
13
13
|
decisions from a generated workspace:
|
|
14
14
|
|
|
15
15
|
- `skills/generated-workspace-architecture.md`
|
|
16
|
+
- `skills/shell-architecture.md` when the request touches member-facing UI,
|
|
17
|
+
operator workflows, threads, channels, cards, dashboards, approvals, or "do
|
|
18
|
+
we need a separate frontend?" questions
|
|
16
19
|
- `skills/runtime-capability-inventory.md`
|
|
17
20
|
- `skills/layering-and-import-modes.md`
|
|
18
21
|
- `skills/capability-gap-reporting.md`
|
|
@@ -23,6 +26,28 @@ decisions from a generated workspace:
|
|
|
23
26
|
- `skills/email-ingress-and-thread-routing.md` when the request touches inboxes,
|
|
24
27
|
aliases, email/SMS/chat routing, or thread-based communication
|
|
25
28
|
|
|
29
|
+
## Shell-First UI Default
|
|
30
|
+
|
|
31
|
+
- For member-facing collaboration and operator work, check shell fit first.
|
|
32
|
+
- The primary collaboration surface is the gateway shell under
|
|
33
|
+
`/w/[workspace_slug]`, not a bespoke standalone tenant frontend.
|
|
34
|
+
- First ask whether the request should be a shell extension:
|
|
35
|
+
- thread metadata
|
|
36
|
+
- cards / attachments in the thread stream
|
|
37
|
+
- agent skills in thread context
|
|
38
|
+
- contextual right-rail detail
|
|
39
|
+
- server-level shared state or catalogs
|
|
40
|
+
- Only propose standalone `tenant-app` UI after explicitly checking shell fit
|
|
41
|
+
and documenting why the request is an exception.
|
|
42
|
+
- If shell fit is correct but the generated workspace cannot directly author the
|
|
43
|
+
needed shell extension, keep the shell-first proposal and record a capability
|
|
44
|
+
gap instead of silently falling back to standalone `tenant-app`.
|
|
45
|
+
- Common exception paths are:
|
|
46
|
+
- public marketing
|
|
47
|
+
- public intake for non-members
|
|
48
|
+
- embeddable widget
|
|
49
|
+
- explicit request for a separate standalone client/app
|
|
50
|
+
|
|
26
51
|
## Starter Choice Matrix
|
|
27
52
|
|
|
28
53
|
The shipped product unit is an `app pack`. `tenant-app` and `sidecar` are
|
|
@@ -30,7 +55,7 @@ implementation surfaces inside that pack.
|
|
|
30
55
|
|
|
31
56
|
| If the request is mainly about... | Choose | Why |
|
|
32
57
|
| --- | --- | --- |
|
|
33
|
-
| Authenticated web UI,
|
|
58
|
+
| Authenticated standalone web UI, separate tenant portal, custom client, or other explicit shell exception | `tenant-app` | This is the Next.js UI/BFF surface after shell fit has been checked. |
|
|
34
59
|
| Public website, pricing, docs, blog, landing pages | `tenant-app` | Public web belongs in the web app surface; do not create a sidecar just to render pages. |
|
|
35
60
|
| Internal API, webhook handler, worker, cron, queue consumer, ingestion, Python-heavy compute | `sidecar` | This is backend/runtime logic, not a browser app concern. |
|
|
36
61
|
| Web app plus background jobs, integrations, AI processing, or internal APIs | `both` | Put UI in `tenant-app`; put backend execution in `sidecar`. |
|
|
@@ -39,7 +64,9 @@ implementation surfaces inside that pack.
|
|
|
39
64
|
|
|
40
65
|
## Default Rule
|
|
41
66
|
|
|
42
|
-
If unsure, start with `tenant-app
|
|
67
|
+
If unsure, check shell fit first. Only start with `tenant-app` after the request
|
|
68
|
+
has been confirmed to be a public surface or an explicit standalone-shell
|
|
69
|
+
exception.
|
|
43
70
|
|
|
44
71
|
Prefer declarative schema/manifests first. Add `sidecar` only when you can name
|
|
45
72
|
a concrete backend responsibility such as:
|
|
@@ -17,5 +17,12 @@ generation, itinerary generation, content generation, or structured-output UX.
|
|
|
17
17
|
missing, or unsupported.
|
|
18
18
|
- If runtime AI availability is unclear, inspect the linked runtime/workspace
|
|
19
19
|
context or ask a clarifying question before inventing new AI infrastructure.
|
|
20
|
+
- When AI drafting or generation touches external participants, guests,
|
|
21
|
+
anonymous/public intake, or pre-claim collaboration, also read
|
|
22
|
+
`shadow-participation-and-guest-threads.md` and
|
|
23
|
+
`email-ingress-and-thread-routing.md` before choosing `tenant-app`, gateway,
|
|
24
|
+
runtime, or `sidecar` surfaces.
|
|
25
|
+
- For guest-facing AI flows, inspect runtime, gateway, and platform ingress
|
|
26
|
+
source before inventing a new collaboration or communications backend.
|
|
20
27
|
- Save drafts and generated outputs as runtime-owned data/content/workflow state
|
|
21
28
|
and publish them through the normal published-web or app flows.
|
|
@@ -8,6 +8,15 @@ An `app pack` is the shipped product unit.
|
|
|
8
8
|
- Start with declarative schema/manifests and add code surfaces only when needed.
|
|
9
9
|
- Use `tenant-app` for the combined public-site plus private-app web surface.
|
|
10
10
|
- Use `sidecar` for internal APIs, workers, integrations, or Python-heavy compute.
|
|
11
|
+
- For member-facing collaboration and operator workflows, check shell fit first
|
|
12
|
+
before proposing standalone `tenant-app` routes or dashboards.
|
|
13
|
+
- Prefer thread metadata, cards/attachments, agent skills, right-rail detail,
|
|
14
|
+
and server-level state when the request belongs inside the shell.
|
|
15
|
+
- Only use standalone `tenant-app` UI by default for public surfaces or when the
|
|
16
|
+
request explicitly asks for a separate client/app.
|
|
17
|
+
- If shell fit is correct but this generated workspace cannot directly author
|
|
18
|
+
the shell extension, record a capability gap instead of silently turning the
|
|
19
|
+
request into a standalone `tenant-app` exception.
|
|
11
20
|
- Treat `mw.core.site` as a runtime baseline capability and compose against it
|
|
12
21
|
instead of trying to install it from the workspace.
|
|
13
22
|
- Reuse existing runtime AI capabilities before adding direct model/provider
|
|
@@ -21,6 +21,31 @@ implementation does not cleanly fit current MinuteWork substrate.
|
|
|
21
21
|
- `suggestedSharedSubstrate`
|
|
22
22
|
- `evidence`
|
|
23
23
|
- `reusability` as `tenantLocalOnly` or `likelyReusable`
|
|
24
|
+
- Field semantics:
|
|
25
|
+
- `currentWorkaround` should describe only the actual current state that exists
|
|
26
|
+
today. Do not describe a planned endpoint, unimplemented route, or proposed
|
|
27
|
+
shared fix as if it already exists.
|
|
28
|
+
- `suggestedSharedSubstrate` should describe the missing capability at the
|
|
29
|
+
contract or substrate level. Keep internal composition choices such as
|
|
30
|
+
`public_handoff` versus direct thread-post dispatch as follow-on design work
|
|
31
|
+
unless the implementation path is already committed.
|
|
32
|
+
- `evidence` should cite real source-backed signals: implemented routes,
|
|
33
|
+
service functions, models, contracts, or explicit unknowns. Avoid simplified
|
|
34
|
+
claims that flatten a richer implementation pattern into one field or helper.
|
|
35
|
+
- Layer heuristics:
|
|
36
|
+
- `baseline_capability` for a shipped built-in system capability that should be
|
|
37
|
+
broadly present by default, such as `mw.core.site`.
|
|
38
|
+
- `runtime_primitive` for a reusable seam composed over existing runtime,
|
|
39
|
+
gateway, ingress, workflow, thread, or AI substrate, but not yet a built-in
|
|
40
|
+
baseline product capability.
|
|
41
|
+
- `reviewed_skill` when the missing piece is Builder-side routing or solution
|
|
42
|
+
guidance rather than runtime/platform substrate.
|
|
43
|
+
- `app_pack` when the missing reusable thing should land as an installable
|
|
44
|
+
product capability rather than a lower-level primitive.
|
|
45
|
+
- `overlay_only` when the gap is presentation, projection, or policy layering
|
|
46
|
+
over existing substrate rather than new execution capability.
|
|
47
|
+
- `attached_app` when the right home is an attached-app integration surface
|
|
48
|
+
rather than shared core substrate.
|
|
24
49
|
- Prefer one concrete gap per missing shared capability.
|
|
25
50
|
- Use gap reports to tell humans where MinuteWork needs new substrate. Do not
|
|
26
51
|
treat them as automatic implementation instructions.
|
|
@@ -24,13 +24,31 @@ workflows, guest chat, or thread-based communication with external parties.
|
|
|
24
24
|
systems.
|
|
25
25
|
- Some provider-specific or polished reply UX may still be partial. Inspect
|
|
26
26
|
source before claiming a turnkey capability exists.
|
|
27
|
+
- Implementation cues in current source:
|
|
28
|
+
- Treat email ingress, public handoff, guest chat, and similar external
|
|
29
|
+
collaboration as one routing family: external identity -> route ->
|
|
30
|
+
thread/workstream continuity -> runtime payload.
|
|
31
|
+
- Platform ingress commonly carries routing and continuity fields such as
|
|
32
|
+
`external_identity_key`, `visitor_email`, `visitor_name`, `surface_key`, and
|
|
33
|
+
`handoff_ref` in `apps/mwv3-platform-dj/apps/published_web/services.py`,
|
|
34
|
+
even when the surface is web rather than email.
|
|
35
|
+
- Runtime post creation can preserve both routing and continuity metadata
|
|
36
|
+
through `user_ref`, `actor_context`, and `continuity_context` in
|
|
37
|
+
`apps/mwv3-runtime-dj/apps/runtime_threads/services.py`. Reuse those fields
|
|
38
|
+
before inventing a second guest payload model.
|
|
39
|
+
- `apps/mwv3-platform-dj/apps/gateway_api/runtime_dispatch.py` shows the same
|
|
40
|
+
routing family dispatching both `public_handoff` and direct user thread-post
|
|
41
|
+
ingress into runtime.
|
|
27
42
|
|
|
28
43
|
Useful inspection points when source is available:
|
|
29
44
|
|
|
30
45
|
- `apps/mwv3-platform-dj/apps/gateway_api/views.py`
|
|
31
46
|
- `apps/mwv3-platform-dj/apps/gateway_api/services.py`
|
|
47
|
+
- `apps/mwv3-platform-dj/apps/gateway_api/runtime_dispatch.py`
|
|
32
48
|
- `apps/mwv3-platform-dj/apps/channels/services.py`
|
|
49
|
+
- `apps/mwv3-platform-dj/apps/published_web/services.py`
|
|
33
50
|
- `apps/mwv3-runtime-dj/apps/runtime_agents/services.py`
|
|
51
|
+
- `apps/mwv3-runtime-dj/apps/runtime_threads/services.py`
|
|
34
52
|
- `apps/mwv3-runtime-dj/apps/runtime_communication/services.py`
|
|
35
53
|
- `reference/mwv3-dj6-docs/agent_mediated_external_workflows.md`
|
|
36
54
|
- `reference/mwv3-dj6-docs/email_connector_wave1_audit.md`
|
|
@@ -17,6 +17,16 @@ the monorepo or a live tenant runtime.
|
|
|
17
17
|
- `tenant-app` and optional `sidecar` are implementation surfaces inside the
|
|
18
18
|
tenant product, not the whole architecture.
|
|
19
19
|
- `tenant-app` is the combined public plus private web starter.
|
|
20
|
+
- For member-facing collaboration and operator work, the primary product surface
|
|
21
|
+
is the gateway shell under `/w/[workspace_slug]`. Do not default to a bespoke
|
|
22
|
+
standalone tenant frontend when the work belongs in shell threads, cards, or
|
|
23
|
+
metadata.
|
|
24
|
+
- Public routes and explicit standalone-client exceptions still belong in
|
|
25
|
+
`tenant-app`; check shell fit first before taking that path.
|
|
26
|
+
- If shell fit is correct but this generated workspace cannot directly author
|
|
27
|
+
the needed shell extension, keep the shell-first proposal and record a
|
|
28
|
+
capability gap instead of silently converting the work into standalone
|
|
29
|
+
`tenant-app` UI.
|
|
20
30
|
- External collaboration is a first-class system pattern. Do not treat guest
|
|
21
31
|
participants, inbound aliases, or shared threads as ad hoc product features.
|
|
22
32
|
- `mw.core.site` is a runtime baseline capability; public site authoring should
|
|
@@ -22,6 +22,22 @@ their own runtime yet.
|
|
|
22
22
|
or provisioning step, not as a silent mutation of the existing guest record.
|
|
23
23
|
- If the needed collaboration primitive does not exist, report a capability gap
|
|
24
24
|
instead of inventing tenant-local substrate blindly.
|
|
25
|
+
- Implementation cues in current source:
|
|
26
|
+
- Platform/public ingress often starts from external-identity fields such as
|
|
27
|
+
`external_identity_key`, `visitor_email`, `visitor_name`, and continuity
|
|
28
|
+
anchors such as `handoff_ref` in
|
|
29
|
+
`apps/mwv3-platform-dj/apps/published_web/services.py`.
|
|
30
|
+
- Inspect `accept_public_handoff(...)` before assuming guest participation
|
|
31
|
+
needs browser auth, a parallel guest table, or a bespoke invite-only model.
|
|
32
|
+
That path already resolves or creates the shadow tenant and shadow person,
|
|
33
|
+
creates a `GUEST_SHARED` thread, and hands continuity off to runtime.
|
|
34
|
+
- Runtime thread posts may carry `actor_context`, `continuity_context`, and
|
|
35
|
+
`user_ref` together in `apps/mwv3-runtime-dj/apps/runtime_threads/services.py`.
|
|
36
|
+
Treat those as complementary context carriers, not as competing identity
|
|
37
|
+
models.
|
|
38
|
+
- Do not reduce external participation to `user_ref` alone. The platform-side
|
|
39
|
+
shadow and external-identity records remain the collaboration anchor even
|
|
40
|
+
when runtime posts also include `user_ref` or other metadata.
|
|
25
41
|
|
|
26
42
|
Useful inspection points when source is available:
|
|
27
43
|
|
|
@@ -31,3 +47,5 @@ Useful inspection points when source is available:
|
|
|
31
47
|
- `apps/mwv3-platform-dj/apps/channels/services.py`
|
|
32
48
|
- `apps/mwv3-platform-dj/apps/identity/services.py`
|
|
33
49
|
- `apps/mwv3-platform-dj/apps/threads/models.py`
|
|
50
|
+
- `apps/mwv3-platform-dj/apps/published_web/services.py`
|
|
51
|
+
- `apps/mwv3-runtime-dj/apps/runtime_threads/services.py`
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Shell Architecture
|
|
2
|
+
|
|
3
|
+
Use this skill when the request touches member-facing UI, operator workflows,
|
|
4
|
+
threads, channels, inboxes, guest collaboration, approvals, dashboards, or
|
|
5
|
+
"should this be a separate frontend?" questions.
|
|
6
|
+
|
|
7
|
+
- Default to the member shell first. For collaboration and operator work, the
|
|
8
|
+
primary product surface is the gateway shell under `/w/[workspace_slug]`, not
|
|
9
|
+
a bespoke standalone tenant frontend.
|
|
10
|
+
- Treat these nouns as the default mental model:
|
|
11
|
+
- **Server**: the product-facing private tenant space
|
|
12
|
+
- **Channel**: a conversation surface inside the shell
|
|
13
|
+
- **Thread**: the unit of work inside a channel
|
|
14
|
+
- **Entry / attachment / card**: the UI that renders inside a thread stream
|
|
15
|
+
- **Member / guest / shadow participant**: visibility and participation roles
|
|
16
|
+
- **Agent**: may appear as a shell channel in the current shell model
|
|
17
|
+
- Current shell truth:
|
|
18
|
+
- the shell is the **primary** collaboration surface, not literally the only
|
|
19
|
+
UI in the repo
|
|
20
|
+
- `/w/[workspace_slug]` redirects into the channel shell routes
|
|
21
|
+
- the current v3 shell implements a left rail, sidebar, main thread area, and
|
|
22
|
+
right rail
|
|
23
|
+
- the current shell proves a fixed agent-like channel set (`superagent`,
|
|
24
|
+
`builder`, `website-admin`); do not assume arbitrary runtime agents already
|
|
25
|
+
auto-materialize as channels unless code or runtime inventory proves it
|
|
26
|
+
- For member-facing operator work, first ask whether the request fits as a shell
|
|
27
|
+
extension:
|
|
28
|
+
- thread metadata extension
|
|
29
|
+
- rich message card / attachment
|
|
30
|
+
- agent skill invoked in thread context
|
|
31
|
+
- server-level shared state or catalog
|
|
32
|
+
- right-panel contextual detail
|
|
33
|
+
- Do **not** default to standalone `/app/*` dashboards or object-management
|
|
34
|
+
routes when the work belongs in threads, cards, metadata, or agent-driven
|
|
35
|
+
conversation.
|
|
36
|
+
- Standalone `tenant-app` UI is an exception path, not the first proposal.
|
|
37
|
+
Consider it when:
|
|
38
|
+
- the user explicitly asks for a separate standalone client
|
|
39
|
+
- the surface is public marketing
|
|
40
|
+
- the surface is public intake for non-members
|
|
41
|
+
- the surface is an embeddable widget
|
|
42
|
+
- If shell fit is correct but this generated workspace cannot directly author
|
|
43
|
+
the shell extension, keep the shell-first recommendation and record a
|
|
44
|
+
capability gap instead of silently converting the request into standalone
|
|
45
|
+
`tenant-app` UI.
|
|
46
|
+
- Be precise about terminology:
|
|
47
|
+
- product/server space: **Server** / **Tenant** in platform docs and models
|
|
48
|
+
- generated local repo: **developer workspace**
|
|
49
|
+
- Do not overclaim current platform reality:
|
|
50
|
+
- shell-first is the intended default
|
|
51
|
+
- the current shell still has static/mock sections and fixed routes
|
|
52
|
+
- not every right-rail or agent/channel extension is a generalized registry
|
|
53
|
+
yet
|
|
54
|
+
- When in doubt, inspect:
|
|
55
|
+
- frontend shell routes and components
|
|
56
|
+
- platform `channels` / `threads` models
|
|
57
|
+
- runtime `ThreadRuntimeBinding` and thread-post models
|
|
58
|
+
- shadow/public-intake/reference contracts
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"template_bundle_ref": "runtime/builder/templates/fastapi-sidecar",
|
|
6
6
|
"template_version": "0.1.0",
|
|
7
7
|
"materialize": {
|
|
8
|
-
"destination": "
|
|
8
|
+
"destination": "sidecar"
|
|
9
9
|
},
|
|
10
10
|
"builder_edit_mode": "workspace_copy_only",
|
|
11
11
|
"seed_source": "runtime/builder/templates/fastapi-sidecar",
|
package/dist/init.js
CHANGED
|
@@ -2,6 +2,7 @@ import { promises as fs } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { materializeManagedWorkspaceAssets } from "./workspace-assets.js";
|
|
5
|
+
import { bootstrapVmLocalWorkspaceEnv } from "./workspace-bootstrap.js";
|
|
5
6
|
const ROOT_ENV_EXAMPLE = `# Optional repo-local MinuteWork CLI overrides.
|
|
6
7
|
# The local platform URL is wired automatically inside a MinuteWork workspace.
|
|
7
8
|
# Starter-local runtime variables stay inside tenant-app/.env.example and sidecar/.env.example.
|
|
@@ -110,6 +111,11 @@ export async function runInit(options) {
|
|
|
110
111
|
if (options.starters.sidecar) {
|
|
111
112
|
await materializeStarter(targetDirectory, workspaceSlug, "sidecar");
|
|
112
113
|
}
|
|
114
|
+
await bootstrapVmLocalWorkspaceEnv({
|
|
115
|
+
cwd: options.cwd,
|
|
116
|
+
starters: options.starters,
|
|
117
|
+
workspaceRoot: targetDirectory,
|
|
118
|
+
});
|
|
113
119
|
return {
|
|
114
120
|
rootDirectory: targetDirectory,
|
|
115
121
|
workspaceSlug,
|
package/dist/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAA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AAC;AAC1E,CAAC;AAED,SAAS,qBAAqB,CAAC,YAAoB,EAAE,cAAwB;IAC3E,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type StarterSelection = {
|
|
2
|
+
tenantApp: boolean;
|
|
3
|
+
sidecar: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function bootstrapVmLocalWorkspaceEnv(options: {
|
|
6
|
+
cwd: string;
|
|
7
|
+
env?: NodeJS.ProcessEnv;
|
|
8
|
+
platform?: NodeJS.Platform;
|
|
9
|
+
starters: StarterSelection;
|
|
10
|
+
workspaceRoot: string;
|
|
11
|
+
}): Promise<boolean>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export async function bootstrapVmLocalWorkspaceEnv(options) {
|
|
4
|
+
const workspaceWiring = await loadVmLocalWorkspaceWiring({
|
|
5
|
+
cwd: options.cwd,
|
|
6
|
+
env: options.env,
|
|
7
|
+
platform: options.platform,
|
|
8
|
+
});
|
|
9
|
+
if (!workspaceWiring) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
if (options.starters.tenantApp) {
|
|
13
|
+
await writeManagedEnvBlock(path.join(options.workspaceRoot, "tenant-app", ".env.local"), "tenant-app", {
|
|
14
|
+
MW_PLATFORM_BASE_URL: workspaceWiring.platform_base_url ?? "",
|
|
15
|
+
MW_CONTENT_API_TOKEN: workspaceWiring.content_token_plaintext ?? "",
|
|
16
|
+
MW_PUBLIC_BASE_URL: workspaceWiring.public_base_url ?? "",
|
|
17
|
+
MW_PUBLIC_SITE_PROPERTY_KEY: workspaceWiring.public_site_property_key ?? "",
|
|
18
|
+
MW_PUBLIC_SITE_ENV: workspaceWiring.public_site_env ?? "preview",
|
|
19
|
+
MW_ENABLE_RUNTIME_COMMAND_EXAMPLE: "false",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (options.starters.sidecar) {
|
|
23
|
+
await writeManagedEnvBlock(path.join(options.workspaceRoot, "sidecar", ".env.local"), "sidecar", {
|
|
24
|
+
MW_API_BASE_URL: workspaceWiring.api_base_url ?? "",
|
|
25
|
+
MW_RUNTIME_ID: workspaceWiring.runtime_id ?? "",
|
|
26
|
+
MW_TENANT_ID: workspaceWiring.tenant_id ?? "",
|
|
27
|
+
MW_RUNTIME_KEY_PATH: workspaceWiring.runtime_key_path ?? "",
|
|
28
|
+
MW_PLATFORM_DISPATCH_TOKEN: workspaceWiring.platform_dispatch_token ?? "",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
async function loadVmLocalWorkspaceWiring(options) {
|
|
34
|
+
const platform = options.platform ?? process.platform;
|
|
35
|
+
if (platform !== "linux") {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const env = options.env ?? process.env;
|
|
39
|
+
const runtimeIdPath = env.MW_RUNTIME_BOOTSTRAP_RUNTIME_ID_FILE ?? "/var/lib/minutework/runtime-id";
|
|
40
|
+
const runtimeId = await readOptionalTrimmedFile(runtimeIdPath);
|
|
41
|
+
if (!runtimeId) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const stateRootOverride = env.MW_RUNTIME_BOOTSTRAP_STATE_ROOT;
|
|
45
|
+
const home = env.HOME ?? process.env.HOME ?? "";
|
|
46
|
+
if (!home) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const wiringPath = stateRootOverride
|
|
50
|
+
? path.join(stateRootOverride, runtimeId, "state", "workspace-wiring.json")
|
|
51
|
+
: path.join(home, ".local", "share", "minutework", "runtimes", runtimeId, "state", "workspace-wiring.json");
|
|
52
|
+
try {
|
|
53
|
+
const payload = JSON.parse(await fs.readFile(wiringPath, "utf8"));
|
|
54
|
+
return Object.fromEntries(Object.entries(payload).map(([key, value]) => [key, String(value ?? "")]));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function writeManagedEnvBlock(targetPath, blockName, values) {
|
|
61
|
+
const startMarker = `# >>> MinuteWork managed: ${blockName}`;
|
|
62
|
+
const endMarker = `# <<< MinuteWork managed: ${blockName}`;
|
|
63
|
+
const renderedBlock = renderManagedEnvBlock(startMarker, endMarker, values);
|
|
64
|
+
const existing = await readOptionalUtf8File(targetPath);
|
|
65
|
+
let nextContent;
|
|
66
|
+
if (existing.includes(startMarker) && existing.includes(endMarker)) {
|
|
67
|
+
const [prefix, remainder] = existing.split(`${startMarker}\n`, 2);
|
|
68
|
+
const [, suffix = ""] = remainder.split(`${endMarker}\n`, 2);
|
|
69
|
+
nextContent = `${prefix}${renderedBlock}${suffix}`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const separator = existing.length === 0 || existing.endsWith("\n") ? "" : "\n";
|
|
73
|
+
nextContent = `${existing}${separator}${renderedBlock}`;
|
|
74
|
+
}
|
|
75
|
+
await fs.mkdir(path.dirname(targetPath), { recursive: true });
|
|
76
|
+
await fs.writeFile(targetPath, nextContent, "utf8");
|
|
77
|
+
}
|
|
78
|
+
function renderManagedEnvBlock(startMarker, endMarker, values) {
|
|
79
|
+
const lines = [startMarker];
|
|
80
|
+
for (const key of Object.keys(values).sort()) {
|
|
81
|
+
lines.push(`${key}=${String(values[key] ?? "").replace(/\n/g, "\\n")}`);
|
|
82
|
+
}
|
|
83
|
+
lines.push(endMarker);
|
|
84
|
+
return `${lines.join("\n")}\n`;
|
|
85
|
+
}
|
|
86
|
+
async function readOptionalTrimmedFile(targetPath) {
|
|
87
|
+
try {
|
|
88
|
+
return (await fs.readFile(targetPath, "utf8")).trim();
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return "";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function readOptionalUtf8File(targetPath) {
|
|
95
|
+
try {
|
|
96
|
+
return await fs.readFile(targetPath, "utf8");
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return "";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=workspace-bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-bootstrap.js","sourceRoot":"","sources":["../src/workspace-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAoB7B,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAMlD;IACC,MAAM,eAAe,GAAG,MAAM,0BAA0B,CAAC;QACvD,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IACH,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC/B,MAAM,oBAAoB,CACxB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,EAC5D,YAAY,EACZ;YACE,oBAAoB,EAAE,eAAe,CAAC,iBAAiB,IAAI,EAAE;YAC7D,oBAAoB,EAAE,eAAe,CAAC,uBAAuB,IAAI,EAAE;YACnE,kBAAkB,EAAE,eAAe,CAAC,eAAe,IAAI,EAAE;YACzD,2BAA2B,EAAE,eAAe,CAAC,wBAAwB,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AI,CAAC;AACjC,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,UAAkB;IACvD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,UAAkB;IACpD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minutework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "MinuteWork CLI for workspace scaffolding, local preview workflows, and hosted preview deploys.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
24
24
|
"jiti": "^2.6.1",
|
|
25
25
|
"zod": "^4.3.6",
|
|
26
|
-
"@minutework/
|
|
27
|
-
"@minutework/
|
|
26
|
+
"@minutework/schema-compiler": "0.1.0",
|
|
27
|
+
"@minutework/platform-config": "0.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^24.9.1",
|