@ampless/admin 0.2.0-alpha.17 → 0.2.0-alpha.19

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/dist/api/index.d.ts +2 -48
  2. package/dist/api/index.js +0 -452
  3. package/dist/chunk-4QYY7CO7.js +358 -0
  4. package/dist/{chunk-T3ONEJ6K.js → chunk-5JKOPRCO.js} +2 -2
  5. package/dist/{chunk-KAMD3SDE.js → chunk-5Q6KVRZ2.js} +2 -2
  6. package/dist/{chunk-WJTZ5BNQ.js → chunk-A3SWBQA6.js} +1 -1
  7. package/dist/{chunk-I5S7J7UZ.js → chunk-BC4B6DLO.js} +2 -2
  8. package/dist/{chunk-5VDMBDFB.js → chunk-CQY55RDG.js} +1 -1
  9. package/dist/{chunk-3EDGG6ST.js → chunk-CVJCMTYB.js} +2 -2
  10. package/dist/{chunk-LIGSQETK.js → chunk-IM5MVZOH.js} +2 -2
  11. package/dist/{chunk-YECVXCET.js → chunk-OSUTPPAU.js} +79 -63
  12. package/dist/{chunk-G7B3R6WQ.js → chunk-QXJIIBUQ.js} +2 -2
  13. package/dist/{chunk-IJKYZNII.js → chunk-S66L5CDS.js} +1 -1
  14. package/dist/{chunk-XFJXMCXX.js → chunk-SRNH2IVA.js} +1 -1
  15. package/dist/{chunk-OYKHRBCF.js → chunk-W6BXESPW.js} +1 -1
  16. package/dist/{chunk-K4GZPMPL.js → chunk-XY4JWSMS.js} +1 -1
  17. package/dist/components/admin-dashboard.js +3 -3
  18. package/dist/components/edit-post-view.js +5 -5
  19. package/dist/components/index.d.ts +1 -1
  20. package/dist/components/index.js +6 -6
  21. package/dist/components/login-view.js +3 -3
  22. package/dist/components/mcp-tokens-view.d.ts +19 -2
  23. package/dist/components/mcp-tokens-view.js +3 -3
  24. package/dist/components/media-view.js +5 -5
  25. package/dist/components/new-post-view.js +5 -5
  26. package/dist/components/posts-list-view.js +3 -3
  27. package/dist/components/users-list-view.js +3 -3
  28. package/dist/{i18n-B1gZ90FD.d.ts → i18n-MWvAMHzn.d.ts} +118 -94
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.js +1 -1
  31. package/dist/metafile-esm.json +1 -1
  32. package/dist/pages/index.d.ts +15 -3
  33. package/dist/pages/index.js +29 -15
  34. package/package.json +3 -3
  35. package/dist/chunk-Q7WU724A.js +0 -205
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useT
4
- } from "./chunk-K4GZPMPL.js";
4
+ } from "./chunk-XY4JWSMS.js";
5
5
 
6
6
  // src/components/users-list-view.tsx
7
7
  import { useEffect, useState } from "react";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useT
4
- } from "./chunk-K4GZPMPL.js";
4
+ } from "./chunk-XY4JWSMS.js";
5
5
 
6
6
  // src/components/login-view.tsx
7
7
  import { useState } from "react";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  translate
4
- } from "./chunk-YECVXCET.js";
4
+ } from "./chunk-OSUTPPAU.js";
5
5
 
6
6
  // src/components/i18n-provider.tsx
7
7
  import { createContext, useContext, useMemo } from "react";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  AdminDashboard
4
- } from "../chunk-5VDMBDFB.js";
5
- import "../chunk-K4GZPMPL.js";
6
- import "../chunk-YECVXCET.js";
4
+ } from "../chunk-CQY55RDG.js";
5
+ import "../chunk-XY4JWSMS.js";
6
+ import "../chunk-OSUTPPAU.js";
7
7
  export {
8
8
  AdminDashboard
9
9
  };
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  EditPostPage
4
- } from "../chunk-T3ONEJ6K.js";
5
- import "../chunk-3EDGG6ST.js";
4
+ } from "../chunk-5JKOPRCO.js";
5
+ import "../chunk-CVJCMTYB.js";
6
6
  import "../chunk-TZWSXAHD.js";
7
7
  import "../chunk-7IR4F7GA.js";
8
- import "../chunk-IJKYZNII.js";
8
+ import "../chunk-S66L5CDS.js";
9
9
  import "../chunk-2ITWLRYF.js";
10
- import "../chunk-K4GZPMPL.js";
11
- import "../chunk-YECVXCET.js";
10
+ import "../chunk-XY4JWSMS.js";
11
+ import "../chunk-OSUTPPAU.js";
12
12
  export {
13
13
  EditPostPage
14
14
  };
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { L as Locale, D as Dictionary } from '../i18n-B1gZ90FD.js';
2
+ import { L as Locale, D as Dictionary } from '../i18n-MWvAMHzn.js';
3
3
  import { Config, Post, ThemeManifest, LocalizedString, MediaProcessingDefaults } from 'ampless';
4
4
  import { AmplessOutputs, ColorScheme } from '@ampless/runtime';
5
5
  import { ProcessOptions } from 'ampless/media';
@@ -5,7 +5,7 @@ import {
5
5
  SiteSelector,
6
6
  SiteSettingsForm,
7
7
  ThemeSettingsForm
8
- } from "../chunk-LIGSQETK.js";
8
+ } from "../chunk-IM5MVZOH.js";
9
9
  import {
10
10
  invalidateSiteSettingsCache
11
11
  } from "../chunk-VXEVLHGL.js";
@@ -14,7 +14,7 @@ import {
14
14
  PostForm,
15
15
  sanitizeName,
16
16
  uploadProcessedImage
17
- } from "../chunk-3EDGG6ST.js";
17
+ } from "../chunk-CVJCMTYB.js";
18
18
  import {
19
19
  readAdminSiteIdFromCookie,
20
20
  setAdminCmsConfig
@@ -24,10 +24,10 @@ import {
24
24
  } from "../chunk-7IR4F7GA.js";
25
25
  import {
26
26
  MediaUploader
27
- } from "../chunk-KAMD3SDE.js";
27
+ } from "../chunk-5Q6KVRZ2.js";
28
28
  import {
29
29
  ImageUploadDialog
30
- } from "../chunk-IJKYZNII.js";
30
+ } from "../chunk-S66L5CDS.js";
31
31
  import {
32
32
  publicMediaUrl,
33
33
  setAdminMediaContext
@@ -36,8 +36,8 @@ import {
36
36
  I18nProvider,
37
37
  useLocale,
38
38
  useT
39
- } from "../chunk-K4GZPMPL.js";
40
- import "../chunk-YECVXCET.js";
39
+ } from "../chunk-XY4JWSMS.js";
40
+ import "../chunk-OSUTPPAU.js";
41
41
  export {
42
42
  ADMIN_SITE_COOKIE,
43
43
  AdminProviders,
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  LoginPage
4
- } from "../chunk-OYKHRBCF.js";
5
- import "../chunk-K4GZPMPL.js";
6
- import "../chunk-YECVXCET.js";
4
+ } from "../chunk-W6BXESPW.js";
5
+ import "../chunk-XY4JWSMS.js";
6
+ import "../chunk-OSUTPPAU.js";
7
7
  export {
8
8
  LoginPage
9
9
  };
@@ -1,5 +1,22 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
- declare function McpTokensView(): react_jsx_runtime.JSX.Element;
3
+ interface SiteOption {
4
+ id: string;
5
+ name: string;
6
+ }
7
+ interface Props {
8
+ /** Cognito sub of the currently logged-in admin. */
9
+ currentUserId: string;
10
+ currentUserEmail: string;
11
+ /** Site list for the scope selector. Empty = single-site mode. */
12
+ sites: SiteOption[];
13
+ /**
14
+ * MCP HTTP endpoint URL (the `mcp-handler` Lambda Function URL).
15
+ * `null` when the project hasn't been deployed yet, so
16
+ * `amplify_outputs.json` doesn't have `custom.mcp.endpoint` populated.
17
+ */
18
+ mcpEndpoint: string | null;
19
+ }
20
+ declare function McpTokensView({ currentUserId, currentUserEmail, sites, mcpEndpoint }: Props): react_jsx_runtime.JSX.Element;
4
21
 
5
- export { McpTokensView };
22
+ export { McpTokensView, type SiteOption };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  McpTokensView
4
- } from "../chunk-Q7WU724A.js";
5
- import "../chunk-K4GZPMPL.js";
6
- import "../chunk-YECVXCET.js";
4
+ } from "../chunk-4QYY7CO7.js";
5
+ import "../chunk-XY4JWSMS.js";
6
+ import "../chunk-OSUTPPAU.js";
7
7
  export {
8
8
  McpTokensView
9
9
  };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  MediaPage
4
- } from "../chunk-G7B3R6WQ.js";
5
- import "../chunk-KAMD3SDE.js";
6
- import "../chunk-IJKYZNII.js";
4
+ } from "../chunk-QXJIIBUQ.js";
5
+ import "../chunk-5Q6KVRZ2.js";
6
+ import "../chunk-S66L5CDS.js";
7
7
  import "../chunk-2ITWLRYF.js";
8
- import "../chunk-K4GZPMPL.js";
9
- import "../chunk-YECVXCET.js";
8
+ import "../chunk-XY4JWSMS.js";
9
+ import "../chunk-OSUTPPAU.js";
10
10
  export {
11
11
  MediaPage
12
12
  };
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  NewPostPage
4
- } from "../chunk-I5S7J7UZ.js";
5
- import "../chunk-3EDGG6ST.js";
4
+ } from "../chunk-BC4B6DLO.js";
5
+ import "../chunk-CVJCMTYB.js";
6
6
  import "../chunk-TZWSXAHD.js";
7
7
  import "../chunk-7IR4F7GA.js";
8
- import "../chunk-IJKYZNII.js";
8
+ import "../chunk-S66L5CDS.js";
9
9
  import "../chunk-2ITWLRYF.js";
10
- import "../chunk-K4GZPMPL.js";
11
- import "../chunk-YECVXCET.js";
10
+ import "../chunk-XY4JWSMS.js";
11
+ import "../chunk-OSUTPPAU.js";
12
12
  export {
13
13
  NewPostPage
14
14
  };
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  PostsList
4
- } from "../chunk-WJTZ5BNQ.js";
4
+ } from "../chunk-A3SWBQA6.js";
5
5
  import "../chunk-TZWSXAHD.js";
6
6
  import "../chunk-7IR4F7GA.js";
7
- import "../chunk-K4GZPMPL.js";
8
- import "../chunk-YECVXCET.js";
7
+ import "../chunk-XY4JWSMS.js";
8
+ import "../chunk-OSUTPPAU.js";
9
9
  export {
10
10
  PostsList
11
11
  };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  UsersListView
4
- } from "../chunk-XFJXMCXX.js";
5
- import "../chunk-K4GZPMPL.js";
6
- import "../chunk-YECVXCET.js";
4
+ } from "../chunk-SRNH2IVA.js";
5
+ import "../chunk-XY4JWSMS.js";
6
+ import "../chunk-OSUTPPAU.js";
7
7
  export {
8
8
  UsersListView
9
9
  };
@@ -182,37 +182,6 @@ var users = {
182
182
  roleNone: "None"
183
183
  }
184
184
  };
185
- var mcpTokens = {
186
- title: "MCP tokens",
187
- description: "Access tokens for the MCP HTTP endpoint at /api/mcp. Use them in Claude Desktop / Cursor / any MCP-aware client to read and write this CMS over the wire.",
188
- setupMissing: "MCP service Cognito user not configured. Set AMPLESS_MCP_SERVICE_EMAIL and AMPLESS_MCP_SERVICE_PASSWORD as Amplify Hosting environment variables and redeploy. See docs/mcp-http-setup.md.",
189
- createTitle: "Create token",
190
- createHint: "Pick a memorable label so you can revoke this token later. Role limits what the token can do — admin can delete posts, editor cannot.",
191
- labelLabel: "Label",
192
- labelPlaceholder: "Claude Desktop — laptop",
193
- roleLabel: "Role",
194
- roleAdmin: "Admin (all tools incl. delete)",
195
- roleEditor: "Editor (cannot delete)",
196
- createButton: "Generate token",
197
- creating: "Generating...",
198
- createdTitle: "Token created — copy it now",
199
- createdHint: "This is the only time the plaintext token will be shown. Copy it into your MCP client config; if you lose it, revoke this token and generate a fresh one.",
200
- copy: "Copy",
201
- copied: "Copied!",
202
- close: "Close",
203
- listTitle: "Active tokens",
204
- listEmpty: "No tokens issued yet.",
205
- columnLabel: "Label",
206
- columnRole: "Role",
207
- columnCreated: "Created",
208
- columnLastUsed: "Last used",
209
- columnActions: "Actions",
210
- lastUsedNever: "Never",
211
- revoke: "Revoke",
212
- revokeConfirm: "Revoke this token? Clients using it will start getting 401 immediately.",
213
- loading: "Loading tokens...",
214
- error: "Failed to load tokens"
215
- };
216
185
  var theme = {
217
186
  title: "Theme",
218
187
  activeLabel: "Active theme",
@@ -298,6 +267,45 @@ var auth = {
298
267
  userExists: "An account with this email already exists."
299
268
  }
300
269
  };
270
+ var mcpTokens = {
271
+ title: "MCP tokens",
272
+ description: "Access tokens for the HTTP MCP endpoint. Use them in Claude Desktop / Cursor / any MCP-aware client to read and write this CMS over the wire.",
273
+ endpointTitle: "MCP endpoint",
274
+ endpointCopy: "Copy",
275
+ endpointCopied: "Copied",
276
+ endpointMissing: "Not deployed yet. Run `npm run sandbox` or push to Amplify Hosting to provision the endpoint URL.",
277
+ inertBanner: "Heads up: the endpoint validates tokens, but tool dispatch (list_posts / create_post / etc.) lands in v0.2 Phase 4. Valid tokens currently get a stub 200 response.",
278
+ createButton: "Create token",
279
+ createModalTitle: "Create token",
280
+ scopeLabel: "Scope",
281
+ scopeAll: "All sites",
282
+ expirationLabel: "Expiration",
283
+ expirationNever: "Never",
284
+ expiration30days: "30 days",
285
+ expiration90days: "90 days",
286
+ expirationCustom: "Custom date",
287
+ issueButton: "Issue token",
288
+ issuing: "Issuing...",
289
+ revealTitle: "Token issued",
290
+ revealHint: "This is the only time you will see this token. Copy it now — closing this dialog discards it permanently.",
291
+ copy: "Copy",
292
+ copied: "Copied!",
293
+ done: "Done",
294
+ loading: "Loading tokens...",
295
+ error: "Failed to load tokens",
296
+ listEmpty: "No tokens yet. Click 'Create token' to issue your first one.",
297
+ columnPrefix: "Prefix",
298
+ columnScope: "Scope",
299
+ columnCreated: "Created",
300
+ columnLastUsed: "Last used",
301
+ columnStatus: "Status",
302
+ lastUsedNever: "Never used",
303
+ statusActive: "Active",
304
+ statusRevoked: "Revoked",
305
+ statusExpired: "Expired",
306
+ revoke: "Revoke",
307
+ revokeConfirm: "Revoke this token? This cannot be undone."
308
+ };
301
309
  var en = {
302
310
  common: common,
303
311
  sidebar: sidebar,
@@ -307,10 +315,10 @@ var en = {
307
315
  mediaPicker: mediaPicker,
308
316
  sites: sites,
309
317
  users: users,
310
- mcpTokens: mcpTokens,
311
318
  theme: theme,
312
319
  editor: editor,
313
320
  auth: auth,
321
+ mcpTokens: mcpTokens,
314
322
  "public": {
315
323
  back: "← Back",
316
324
  home: "← Home",
@@ -505,37 +513,6 @@ declare const dictionaries: {
505
513
  roleNone: string;
506
514
  };
507
515
  };
508
- mcpTokens: {
509
- title: string;
510
- description: string;
511
- setupMissing: string;
512
- createTitle: string;
513
- createHint: string;
514
- labelLabel: string;
515
- labelPlaceholder: string;
516
- roleLabel: string;
517
- roleAdmin: string;
518
- roleEditor: string;
519
- createButton: string;
520
- creating: string;
521
- createdTitle: string;
522
- createdHint: string;
523
- copy: string;
524
- copied: string;
525
- close: string;
526
- listTitle: string;
527
- listEmpty: string;
528
- columnLabel: string;
529
- columnRole: string;
530
- columnCreated: string;
531
- columnLastUsed: string;
532
- columnActions: string;
533
- lastUsedNever: string;
534
- revoke: string;
535
- revokeConfirm: string;
536
- loading: string;
537
- error: string;
538
- };
539
516
  theme: {
540
517
  title: string;
541
518
  activeLabel: string;
@@ -621,6 +598,45 @@ declare const dictionaries: {
621
598
  userExists: string;
622
599
  };
623
600
  };
601
+ mcpTokens: {
602
+ title: string;
603
+ description: string;
604
+ endpointTitle: string;
605
+ endpointCopy: string;
606
+ endpointCopied: string;
607
+ endpointMissing: string;
608
+ inertBanner: string;
609
+ createButton: string;
610
+ createModalTitle: string;
611
+ scopeLabel: string;
612
+ scopeAll: string;
613
+ expirationLabel: string;
614
+ expirationNever: string;
615
+ expiration30days: string;
616
+ expiration90days: string;
617
+ expirationCustom: string;
618
+ issueButton: string;
619
+ issuing: string;
620
+ revealTitle: string;
621
+ revealHint: string;
622
+ copy: string;
623
+ copied: string;
624
+ done: string;
625
+ loading: string;
626
+ error: string;
627
+ listEmpty: string;
628
+ columnPrefix: string;
629
+ columnScope: string;
630
+ columnCreated: string;
631
+ columnLastUsed: string;
632
+ columnStatus: string;
633
+ lastUsedNever: string;
634
+ statusActive: string;
635
+ statusRevoked: string;
636
+ statusExpired: string;
637
+ revoke: string;
638
+ revokeConfirm: string;
639
+ };
624
640
  public: {
625
641
  back: string;
626
642
  home: string;
@@ -813,37 +829,6 @@ declare const dictionaries: {
813
829
  roleNone: string;
814
830
  };
815
831
  };
816
- mcpTokens: {
817
- title: string;
818
- description: string;
819
- setupMissing: string;
820
- createTitle: string;
821
- createHint: string;
822
- labelLabel: string;
823
- labelPlaceholder: string;
824
- roleLabel: string;
825
- roleAdmin: string;
826
- roleEditor: string;
827
- createButton: string;
828
- creating: string;
829
- createdTitle: string;
830
- createdHint: string;
831
- copy: string;
832
- copied: string;
833
- close: string;
834
- listTitle: string;
835
- listEmpty: string;
836
- columnLabel: string;
837
- columnRole: string;
838
- columnCreated: string;
839
- columnLastUsed: string;
840
- columnActions: string;
841
- lastUsedNever: string;
842
- revoke: string;
843
- revokeConfirm: string;
844
- loading: string;
845
- error: string;
846
- };
847
832
  theme: {
848
833
  title: string;
849
834
  activeLabel: string;
@@ -929,6 +914,45 @@ declare const dictionaries: {
929
914
  userExists: string;
930
915
  };
931
916
  };
917
+ mcpTokens: {
918
+ title: string;
919
+ description: string;
920
+ endpointTitle: string;
921
+ endpointCopy: string;
922
+ endpointCopied: string;
923
+ endpointMissing: string;
924
+ inertBanner: string;
925
+ createButton: string;
926
+ createModalTitle: string;
927
+ scopeLabel: string;
928
+ scopeAll: string;
929
+ expirationLabel: string;
930
+ expirationNever: string;
931
+ expiration30days: string;
932
+ expiration90days: string;
933
+ expirationCustom: string;
934
+ issueButton: string;
935
+ issuing: string;
936
+ revealTitle: string;
937
+ revealHint: string;
938
+ copy: string;
939
+ copied: string;
940
+ done: string;
941
+ loading: string;
942
+ error: string;
943
+ listEmpty: string;
944
+ columnPrefix: string;
945
+ columnScope: string;
946
+ columnCreated: string;
947
+ columnLastUsed: string;
948
+ columnStatus: string;
949
+ lastUsedNever: string;
950
+ statusActive: string;
951
+ statusRevoked: string;
952
+ statusExpired: string;
953
+ revoke: string;
954
+ revokeConfirm: string;
955
+ };
932
956
  public: {
933
957
  back: string;
934
958
  home: string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Config } from 'ampless';
2
2
  import { AmplessOutputs, EffectiveSiteSettings, EffectiveThemeConfig, Ampless } from '@ampless/runtime';
3
- import { L as Locale, D as Dictionary } from './i18n-B1gZ90FD.js';
4
- export { A as AdminLocaleStrings, g as getDictionary, r as resolveLocale, t as translate } from './i18n-B1gZ90FD.js';
3
+ import { L as Locale, D as Dictionary } from './i18n-MWvAMHzn.js';
4
+ export { A as AdminLocaleStrings, g as getDictionary, r as resolveLocale, t as translate } from './i18n-MWvAMHzn.js';
5
5
  import * as _aws_amplify_adapter_nextjs from '@aws-amplify/adapter-nextjs';
6
6
 
7
7
  /**
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  getDictionary,
9
9
  resolveLocale,
10
10
  translate
11
- } from "./chunk-YECVXCET.js";
11
+ } from "./chunk-OSUTPPAU.js";
12
12
 
13
13
  // src/lib/admin-site.ts
14
14
  import { cookies } from "next/headers";