@mulmoclaude/mulmoscript-plugin 0.1.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 (62) hide show
  1. package/dist/core/contract.d.ts +162 -0
  2. package/dist/core/contract.d.ts.map +1 -0
  3. package/dist/core/definition.d.ts +4 -0
  4. package/dist/core/definition.d.ts.map +1 -0
  5. package/dist/core/index.d.ts +6 -0
  6. package/dist/core/index.d.ts.map +1 -0
  7. package/dist/core/paths.d.ts +21 -0
  8. package/dist/core/paths.d.ts.map +1 -0
  9. package/dist/core/plugin.d.ts +44 -0
  10. package/dist/core/plugin.d.ts.map +1 -0
  11. package/dist/core/types.d.ts +29 -0
  12. package/dist/core/types.d.ts.map +1 -0
  13. package/dist/core/validate.d.ts +27 -0
  14. package/dist/core/validate.d.ts.map +1 -0
  15. package/dist/index.cjs +14 -0
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +2 -0
  19. package/dist/lang/de.d.ts +4 -0
  20. package/dist/lang/de.d.ts.map +1 -0
  21. package/dist/lang/en.d.ts +4 -0
  22. package/dist/lang/en.d.ts.map +1 -0
  23. package/dist/lang/es.d.ts +4 -0
  24. package/dist/lang/es.d.ts.map +1 -0
  25. package/dist/lang/fr.d.ts +4 -0
  26. package/dist/lang/fr.d.ts.map +1 -0
  27. package/dist/lang/index.d.ts +9 -0
  28. package/dist/lang/index.d.ts.map +1 -0
  29. package/dist/lang/ja.d.ts +4 -0
  30. package/dist/lang/ja.d.ts.map +1 -0
  31. package/dist/lang/ko.d.ts +4 -0
  32. package/dist/lang/ko.d.ts.map +1 -0
  33. package/dist/lang/messages.d.ts +36 -0
  34. package/dist/lang/messages.d.ts.map +1 -0
  35. package/dist/lang/ptBR.d.ts +4 -0
  36. package/dist/lang/ptBR.d.ts.map +1 -0
  37. package/dist/lang/zh.d.ts +4 -0
  38. package/dist/lang/zh.d.ts.map +1 -0
  39. package/dist/plugin-CtKUt8DX.cjs +451 -0
  40. package/dist/plugin-CtKUt8DX.cjs.map +1 -0
  41. package/dist/plugin-W1ppnyhR.js +380 -0
  42. package/dist/plugin-W1ppnyhR.js.map +1 -0
  43. package/dist/style.css +1635 -0
  44. package/dist/vue/Preview.vue.d.ts +9 -0
  45. package/dist/vue/Preview.vue.d.ts.map +1 -0
  46. package/dist/vue/View.vue.d.ts +13 -0
  47. package/dist/vue/View.vue.d.ts.map +1 -0
  48. package/dist/vue/helpers.d.ts +67 -0
  49. package/dist/vue/helpers.d.ts.map +1 -0
  50. package/dist/vue/hostAdapter.d.ts +16 -0
  51. package/dist/vue/hostAdapter.d.ts.map +1 -0
  52. package/dist/vue/index.d.ts +18 -0
  53. package/dist/vue/index.d.ts.map +1 -0
  54. package/dist/vue/support.d.ts +15 -0
  55. package/dist/vue/support.d.ts.map +1 -0
  56. package/dist/vue/transport.d.ts +20 -0
  57. package/dist/vue/transport.d.ts.map +1 -0
  58. package/dist/vue.cjs +1984 -0
  59. package/dist/vue.cjs.map +1 -0
  60. package/dist/vue.js +1971 -0
  61. package/dist/vue.js.map +1 -0
  62. package/package.json +61 -0
@@ -0,0 +1,9 @@
1
+ import type { ToolResultComplete } from "gui-chat-protocol/vue";
2
+ import type { MulmoScriptData } from "../core/types";
3
+ type __VLS_Props = {
4
+ result: ToolResultComplete<MulmoScriptData>;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ //# sourceMappingURL=Preview.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Preview.vue.d.ts","sourceRoot":"","sources":["../../src/vue/Preview.vue"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,KAAK,WAAW,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAA;CAAE,CAAC;AAuDnE,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,13 @@
1
+ import type { ToolResultComplete } from "gui-chat-protocol/vue";
2
+ import type { MulmoScriptData } from "../core/types";
3
+ type __VLS_Props = {
4
+ selectedResult: ToolResultComplete<MulmoScriptData>;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ updateResult: (result: ToolResultComplete<unknown, unknown>) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onUpdateResult?: ((result: ToolResultComplete<unknown, unknown>) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ //# sourceMappingURL=View.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"View.vue.d.ts","sourceRoot":"","sources":["../../src/vue/View.vue"],"names":[],"mappings":"AAg3DA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAwDrD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACrD,CAAC;AAy0FF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Decide whether a beat should be rendered automatically at
3
+ * script load time. Text-based beats (slides, charts, etc.) are
4
+ * auto-rendered only when the script has no characters —
5
+ * characters must be rendered first so they can be referenced by
6
+ * any character-using beat.
7
+ */
8
+ export declare function shouldAutoRenderBeat(beat: {
9
+ image?: {
10
+ type?: string;
11
+ };
12
+ }, hasCharacters: boolean, autoRenderTypes: readonly string[]): boolean;
13
+ /**
14
+ * Of the given character keys, return those whose image is not
15
+ * yet loaded and is not currently rendering. Used to fetch only
16
+ * what's missing after a movie-generation event arrives.
17
+ */
18
+ export declare function getMissingCharacterKeys(keys: readonly string[], images: Record<string, unknown>, renderState: Record<string, string | undefined>): string[];
19
+ /**
20
+ * A schema shape that exposes `safeParse` — matches Zod's API
21
+ * without pulling the dep into this module.
22
+ */
23
+ export interface SafeParseSchema {
24
+ safeParse: (value: unknown) => {
25
+ success: boolean;
26
+ };
27
+ }
28
+ /**
29
+ * Validate a candidate Beat JSON string against a schema.
30
+ * Returns false on any JSON parse error or schema mismatch.
31
+ */
32
+ export declare function validateBeatJSON(json: string, schema: SafeParseSchema): boolean;
33
+ /**
34
+ * Stable structural equality for two MulmoScripts via JSON
35
+ * canonicalisation. We compare the full re-serialised string
36
+ * rather than walking keys because (a) MulmoScript is
37
+ * deeply-nested and Object.keys-recursion would be ~50 lines, and
38
+ * (b) `JSON.stringify` already preserves insertion order, which
39
+ * `mulmoScriptSchema.safeParse` keeps stable across runs of the
40
+ * same input. False positives (= "differ" when they don't) only
41
+ * cost an extra `emit("updateResult", ...)` which is a no-op when
42
+ * data hasn't actually changed.
43
+ */
44
+ export declare function isSameScript(left: unknown, right: unknown): boolean;
45
+ /**
46
+ * True when a beat can have a generated video clip on disk — used to
47
+ * decide whether to probe the beat-movie endpoint. `moviePrompt`
48
+ * beats produce a per-beat movie file; `html_tailwind` beats with
49
+ * `animation` set (either `true` or an options object) produce an
50
+ * `_animated.mp4` render.
51
+ */
52
+ export declare function beatMayHaveMovie(beat: {
53
+ moviePrompt?: string;
54
+ image?: {
55
+ type?: string;
56
+ animation?: unknown;
57
+ };
58
+ }): boolean;
59
+ /** Pure check: is every beat in the script a `slide`-typed beat?
60
+ * When true, the View mounts `@mulmocast/deck-web`'s
61
+ * `MulmoScriptDeckEditor` instead of the per-beat list UI (#1575).
62
+ * Empty / missing `beats[]` returns false — there's nothing to edit
63
+ * as a deck, fall through to the existing UI which renders an empty
64
+ * state. Mixed scripts (any non-`slide` beat) also return false; that
65
+ * case is deferred to a future phase. */
66
+ export declare function isAllSlideDeck(script: unknown): boolean;
67
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/vue/helpers.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAK7I;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,EAAE,CAE3J;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CACrD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAQ/E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,GAAG,OAAO,CAGxH;AAED;;;;;;0CAM0C;AAC1C,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CASvD"}
@@ -0,0 +1,16 @@
1
+ import { type InjectionKey, type Ref } from "vue";
2
+ export interface MulmoScriptHostAdapter {
3
+ /** Active chat session id, forwarded on generation dispatches so the
4
+ * host can light its per-session progress indicators. */
5
+ chatSessionId?: Ref<string | undefined>;
6
+ /** Authenticated media download. Exactly one of `moviePath` / `pdfPath`
7
+ * is set — both are the wire `stories/…` paths the status/probe
8
+ * dispatches return. Rejects on transport/HTTP failure. */
9
+ fetchMediaBlob?: (query: {
10
+ moviePath?: string;
11
+ pdfPath?: string;
12
+ }) => Promise<Blob>;
13
+ }
14
+ export declare const MULMOSCRIPT_HOST_ADAPTER_KEY: InjectionKey<MulmoScriptHostAdapter>;
15
+ export declare function useHostAdapter(): MulmoScriptHostAdapter;
16
+ //# sourceMappingURL=hostAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hostAdapter.d.ts","sourceRoot":"","sources":["../../src/vue/hostAdapter.ts"],"names":[],"mappings":"AAaA,OAAO,EAAU,KAAK,YAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1D,MAAM,WAAW,sBAAsB;IACrC;8DAC0D;IAC1D,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;gEAE4D;IAC5D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrF;AAED,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,sBAAsB,CAAsC,CAAC;AAIrH,wBAAgB,cAAc,IAAI,sBAAsB,CAEvD"}
@@ -0,0 +1,18 @@
1
+ import "../style.css";
2
+ import type { ToolPlugin } from "gui-chat-protocol/vue";
3
+ import type { MulmoScriptData, SaveMulmoScriptArgs } from "../core/types";
4
+ import View from "./View.vue";
5
+ import Preview from "./Preview.vue";
6
+ export declare const plugin: ToolPlugin<MulmoScriptData, MulmoScriptData, SaveMulmoScriptArgs>;
7
+ export type { MulmoScriptData, MulmoScriptExecuteContext, SaveMulmoScriptArgs } from "../core/types";
8
+ export type { MulmoScriptDispatchArgs, MulmoScriptDispatchResult, MulmoScriptGenerationEvent, DispatchEnvelope, DispatchFailure } from "../core/contract";
9
+ export { GENERATION_EVENT } from "../core/contract";
10
+ export { TOOL_NAME, TOOL_DEFINITION } from "../core/definition";
11
+ export { MULMOSCRIPT_HOST_ADAPTER_KEY, useHostAdapter, type MulmoScriptHostAdapter } from "./hostAdapter";
12
+ export { useMulmoScriptTransport, type MulmoScriptTransport, type TransportResult } from "./transport";
13
+ export { View, Preview };
14
+ declare const _default: {
15
+ plugin: ToolPlugin<MulmoScriptData, MulmoScriptData, SaveMulmoScriptArgs, import("gui-chat-protocol/vue").InputHandler, Record<string, unknown>>;
16
+ };
17
+ export default _default;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAIpF,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACrG,YAAY,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1J,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,uBAAuB,EAAE,KAAK,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;;;AAEzB,wBAA0B"}
@@ -0,0 +1,15 @@
1
+ import { type Ref } from "vue";
2
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
3
+ /** Canonical unknown-caught-value → human-readable string. Non-Error
4
+ * objects with a `details` (gRPC convention) or `message` string field
5
+ * have that field surfaced. */
6
+ export declare function errorMessage(err: unknown, fallback?: string): string;
7
+ export interface UseClipboardCopyHandle {
8
+ copied: Ref<boolean>;
9
+ copy: (text: string) => Promise<void>;
10
+ }
11
+ /** Clipboard failures (permissions, insecure context) are swallowed on
12
+ * purpose: the UI just leaves the "Copied!" hint off, which is what
13
+ * `copied=false` already signals. */
14
+ export declare function useClipboardCopy(resetMs?: number): UseClipboardCopyHandle;
15
+ //# sourceMappingURL=support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/vue/support.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;;gCAEgC;AAChC,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CASpE;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED;;sCAEsC;AACtC,wBAAgB,gBAAgB,CAAC,OAAO,SAAO,GAAG,sBAAsB,CAgBvE"}
@@ -0,0 +1,20 @@
1
+ import type { MulmoScriptDispatchArgs, MulmoScriptDispatchResult, MulmoScriptGenerationEvent } from "../core/contract";
2
+ export type TransportResult<T> = {
3
+ ok: true;
4
+ data: T;
5
+ } | {
6
+ ok: false;
7
+ error: string;
8
+ };
9
+ type ArgsFor<K extends MulmoScriptDispatchArgs["kind"]> = Omit<Extract<MulmoScriptDispatchArgs, {
10
+ kind: K;
11
+ }>, "kind">;
12
+ export interface MulmoScriptTransport {
13
+ call<K extends MulmoScriptDispatchArgs["kind"]>(kind: K, args: ArgsFor<K>): Promise<TransportResult<MulmoScriptDispatchResult[K]>>;
14
+ /** Subscribe to the host's generation channel, pre-filtered to one
15
+ * script's wire path. Returns the unsubscribe function. */
16
+ onGenerationEvent(filePath: () => string, handler: (event: MulmoScriptGenerationEvent) => void): () => void;
17
+ }
18
+ export declare function useMulmoScriptTransport(): MulmoScriptTransport;
19
+ export {};
20
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/vue/transport.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAIvH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,KAAK,OAAO,CAAC,CAAC,SAAS,uBAAuB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAkBtH,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,CAAC,SAAS,uBAAuB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnI;gEAC4D;IAC5D,iBAAiB,CAAC,QAAQ,EAAE,MAAM,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7G;AAED,wBAAgB,uBAAuB,IAAI,oBAAoB,CA4B9D"}