ask-marcel-office-cli 2.2.0 → 2.4.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 (35) hide show
  1. package/CHANGELOG.md +201 -0
  2. package/README.md +45 -26
  3. package/dist/cli.js +2964 -2446
  4. package/dist/commands.json +254 -727
  5. package/dist/composition/run-registry-command.d.ts +12 -3
  6. package/dist/domain/utilities/base64.d.ts +11 -0
  7. package/dist/index.js +2121 -1737
  8. package/dist/infra/auth.d.ts +30 -4
  9. package/dist/infra/browser-auth.d.ts +21 -1
  10. package/dist/presenter/output-text.d.ts +1 -1
  11. package/dist/presenter/output.d.ts +2 -2
  12. package/dist/presenter/render-to-string.d.ts +42 -2
  13. package/dist/use-cases/commands/command-types.d.ts +1 -20
  14. package/dist/use-cases/commands/create-forward-draft.d.ts +1 -1
  15. package/dist/use-cases/commands/create-reply-draft.d.ts +1 -1
  16. package/dist/use-cases/commands/docs-render.d.ts +0 -1
  17. package/dist/use-cases/commands/docx-metadata.d.ts +32 -2
  18. package/dist/use-cases/commands/draft-comment-splicer.d.ts +8 -1
  19. package/dist/use-cases/commands/include-hidden-folders.d.ts +2 -0
  20. package/dist/use-cases/commands/list-mail-folder-messages-delta.d.ts +10 -2
  21. package/dist/use-cases/commands/list-shared-mailbox-child-folders.d.ts +4 -0
  22. package/dist/use-cases/commands/list-shared-mailbox-folders.d.ts +4 -0
  23. package/dist/use-cases/commands/login-status.d.ts +2 -0
  24. package/dist/use-cases/commands/login.d.ts +18 -8
  25. package/dist/use-cases/commands/next-page.d.ts +1 -0
  26. package/dist/use-cases/commands/ooxml-xml-walker.d.ts +31 -6
  27. package/dist/use-cases/commands/pptx-comments.d.ts +8 -5
  28. package/dist/use-cases/commands/reject-unknown-params.d.ts +16 -0
  29. package/dist/use-cases/commands/resolve-command.d.ts +7 -9
  30. package/dist/use-cases/commands/search-onenote-pages.d.ts +1 -1
  31. package/dist/use-cases/commands/token-tier-capability.d.ts +5 -0
  32. package/dist/use-cases/commands/update-mail-draft.d.ts +4 -0
  33. package/docs/COMMANDS.md +15 -13
  34. package/docs/USAGE.md +2 -2
  35. package/package.json +25 -9
@@ -1,10 +1,17 @@
1
1
  import type { GraphClient } from '../infra/graph-client.js';
2
2
  import type { ErrorSource } from '../presenter/error-hints.js';
3
+ import type { RenderContext, RenderSurface } from '../presenter/render-to-string.js';
3
4
  import type { Command } from '../use-cases/commands/command-types.js';
4
5
  import type { OutputDirError, OutputPathError } from '../use-cases/commands/output-path.js';
5
6
  import type { Result } from '../domain/result.js';
6
7
  import type { FileSystem } from '../use-cases/ports/filesystem.js';
7
- declare const formatOutputPathError: (error: OutputPathError, commandName: string) => string;
8
+ /**
9
+ * The facts the oversized-response banner needs to name a remedy this caller
10
+ * can actually use. Derived from the manifest, so a new command gets an honest
11
+ * banner for free. See `RenderContext` in the presenter for the why.
12
+ */
13
+ declare const buildRenderContext: (commandName: string, command: Command, surface: RenderSurface, params: Record<string, unknown>) => RenderContext;
14
+ declare const formatOutputPathError: (error: OutputPathError, commandName: string, surface: RenderSurface) => string;
8
15
  declare const formatOutputDirError: (error: OutputDirError, commandName: string) => string;
9
16
  export type RunRegistryCommandDeps = {
10
17
  readonly graph: GraphClient;
@@ -14,10 +21,12 @@ export type RunRegistryCommandRequest = {
14
21
  /** Canonical registry name — drives the manifest-derived error messages. */
15
22
  readonly name: string;
16
23
  readonly command: Command;
17
- /** Raw params, still possibly keyed by an option ALIAS. */
24
+ /** Raw params, keyed by the canonical camelCase option keys. */
18
25
  readonly params: Record<string, string>;
19
26
  readonly outputPath?: string;
20
27
  readonly outputDir?: string;
28
+ /** Which front end asked. Decides whether a remedy may mention a shell. */
29
+ readonly surface: RenderSurface;
21
30
  };
22
31
  /**
23
32
  * `source` / `code` / `retryAfterSeconds` are optional on purpose: the
@@ -31,4 +40,4 @@ export type RunRegistryCommandFailure = {
31
40
  readonly retryAfterSeconds?: number;
32
41
  };
33
42
  export declare const runRegistryCommand: (deps: RunRegistryCommandDeps, request: RunRegistryCommandRequest) => Promise<Result<unknown, RunRegistryCommandFailure>>;
34
- export { formatOutputDirError, formatOutputPathError };
43
+ export { buildRenderContext, formatOutputDirError, formatOutputPathError };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Encode raw bytes to standard base64.
3
+ *
4
+ * Built byte-by-byte into a Latin-1 binary string so every value stays in
5
+ * `btoa`'s 0x00-0xFF input range — `btoa` throws on any code unit above 0xFF,
6
+ * and the char-at-a-time loop avoids the call-stack blow-up of
7
+ * `String.fromCharCode(...bytes)` on large inputs.
8
+ *
9
+ * Callers that need base64url apply the `+`/`/`/`=` transform themselves.
10
+ */
11
+ export declare const bytesToBase64: (bytes: Uint8Array) => string;