@ampless/runtime 1.0.0-beta.75 → 1.0.0-beta.78

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/README.ja.md CHANGED
@@ -121,7 +121,7 @@ CORS(匿名・読み取り専用)、64KB のボディ上限、粗い warm-in
121
121
  また、`post.metadata.cache`(auto / deep / hot)+ `post.updatedAt` +
122
122
  `cms.config.cache.{cooldownMs, freshTtlSeconds, deepTtlSeconds}` から
123
123
  `Cache-Control` を算出してレスポンスに付与します。キャッシュ戦略の
124
- 契約については `docs/CONTENT.md` を参照してください。
124
+ 契約については `https://github.com/heavymoons/ampless/wiki/CONTENT` を参照してください。
125
125
 
126
126
  ## サブパス
127
127
 
package/README.md CHANGED
@@ -119,7 +119,7 @@ returns `{ POST, OPTIONS }`; the template destructures both (a single
119
119
  It also computes `Cache-Control` from `post.metadata.cache` (auto /
120
120
  deep / hot) + `post.updatedAt` + `cms.config.cache.{cooldownMs,
121
121
  freshTtlSeconds, deepTtlSeconds}` and sets the header on the response.
122
- See `docs/CONTENT.md` for the cache strategy contract.
122
+ See `https://github.com/heavymoons/ampless/wiki/CONTENT` for the cache strategy contract.
123
123
 
124
124
  ## Sub-paths
125
125
 
@@ -1,6 +1,5 @@
1
1
  // src/stream-s3.ts
2
2
  import { getProperties } from "aws-amplify/storage/server";
3
- import { cookies } from "next/headers";
4
3
  var DEFAULT_THRESHOLD_BYTES = 6 * 1024 * 1024;
5
4
  var META_CACHE_MAX = 1e3;
6
5
  var META_CACHE_TTL_MS = 5 * 6e4;
@@ -111,7 +110,7 @@ async function streamS3Object(amplifyServerContext, key, options) {
111
110
  }
112
111
  async function streamS3ObjectWithRunner(runWithAmplifyServerContext, key, options) {
113
112
  return runWithAmplifyServerContext({
114
- nextServerContext: { cookies },
113
+ nextServerContext: null,
115
114
  operation: (ctx) => streamS3Object(ctx, key, options)
116
115
  });
117
116
  }
@@ -3,7 +3,6 @@ import { Metadata } from 'next';
3
3
  import { Ampless } from '../index.js';
4
4
  import 'ampless';
5
5
  import 'aws-amplify/storage/server';
6
- import 'next/headers';
7
6
 
8
7
  interface Props$2 {
9
8
  params: Promise<Record<string, never>>;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@ export { Config, Post, ThemeManifest } from 'ampless';
3
3
  import { Metadata } from 'next';
4
4
  import { ReactNode } from 'react';
5
5
  import { getProperties } from 'aws-amplify/storage/server';
6
- import { cookies } from 'next/headers';
7
6
 
8
7
  interface StorageOutput {
9
8
  bucket_name: string;
@@ -625,16 +624,17 @@ declare function _resetStreamS3Cache(): void;
625
624
  */
626
625
  declare function streamS3Object(amplifyServerContext: AmplifyServerContext, key: string, options: StreamS3Options): Promise<Response>;
627
626
  /**
628
- * Convenience wrapper that pulls in the standard Amplify SSR cookie
629
- * adapter so route handlers don't have to duplicate the
627
+ * Convenience wrapper so route handlers don't have to duplicate the
630
628
  * `runWithAmplifyServerContext` plumbing. Pass the runner from
631
629
  * `createServerRunner({ config: outputs })` and the rest is the same
632
630
  * shape as `streamS3Object`.
631
+ *
632
+ * Runs with `nextServerContext: null` (Amplify's stateless guest path):
633
+ * no cookie read or write, so the public-cacheable response can never
634
+ * carry a Set-Cookie.
633
635
  */
634
636
  declare function streamS3ObjectWithRunner(runWithAmplifyServerContext: <T>(args: {
635
- nextServerContext: {
636
- cookies: typeof cookies;
637
- };
637
+ nextServerContext: null;
638
638
  operation: (ctx: AmplifyServerContext) => Promise<T>;
639
639
  }) => Promise<T>, key: string, options: StreamS3Options): Promise<Response>;
640
640
 
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  _resetStreamS3Cache,
8
8
  streamS3Object,
9
9
  streamS3ObjectWithRunner
10
- } from "./chunk-5BLMLMZU.js";
10
+ } from "./chunk-PK7Q7YJX.js";
11
11
 
12
12
  // src/storage.ts
13
13
  import { formatPublicAssetUrl } from "ampless";
@@ -3,7 +3,6 @@ import 'ampless';
3
3
  import 'next';
4
4
  import 'react';
5
5
  import 'aws-amplify/storage/server';
6
- import 'next/headers';
7
6
 
8
7
  interface Ctx$6 {
9
8
  params: Promise<{
@@ -55,7 +54,7 @@ type RawRouteHandler = (req: Request, ctx: Ctx$3) => Promise<Response>;
55
54
  *
56
55
  * Trust model: the body is emitted verbatim, same trust shape as
57
56
  * regular `format: 'html'` posts on the themed route. See
58
- * docs/architecture/04-access-layer-mcp.md §"editor の信頼モデル".
57
+ * https://github.com/heavymoons/ampless/wiki/architecture-04-access-layer-mcp §"editor の信頼モデル".
59
58
  *
60
59
  * Cache-Control: deliberately omitted from the response. Middleware
61
60
  * computes the strategy from `post.metadata.cache` + `post.updatedAt`
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  streamS3Object
3
- } from "../chunk-5BLMLMZU.js";
3
+ } from "../chunk-PK7Q7YJX.js";
4
4
 
5
5
  // src/routes/og.ts
6
6
  import { ImageResponse } from "next/og";
@@ -92,7 +92,6 @@ function createRawRouteHandler(ampless) {
92
92
 
93
93
  // src/routes/static.ts
94
94
  import { createServerRunner } from "@aws-amplify/adapter-nextjs";
95
- import { cookies } from "next/headers";
96
95
  import { getUrl } from "aws-amplify/storage/server";
97
96
  function createStaticRouteHandler(ampless) {
98
97
  const { runWithAmplifyServerContext } = createServerRunner({
@@ -160,7 +159,7 @@ async function serveStaticAsset({
160
159
  presignedUrlFor: (k) => signStaticAsset({ runWithAmplifyServerContext, key: k })
161
160
  };
162
161
  return runWithAmplifyServerContext({
163
- nextServerContext: { cookies },
162
+ nextServerContext: null,
164
163
  operation: (ctx) => streamS3Object(ctx, key, opts)
165
164
  });
166
165
  }
@@ -170,7 +169,7 @@ async function signStaticAsset({
170
169
  }) {
171
170
  try {
172
171
  return await runWithAmplifyServerContext({
173
- nextServerContext: { cookies },
172
+ nextServerContext: null,
174
173
  operation: async (amplifyContext) => {
175
174
  const result = await getUrl(amplifyContext, {
176
175
  path: key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/runtime",
3
- "version": "1.0.0-beta.75",
3
+ "version": "1.0.0-beta.78",
4
4
  "description": "Public-side runtime for ampless: post fetching, theme dispatch, middleware, public route handlers",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,11 +49,11 @@
49
49
  "htmlparser2": "^10.1.0",
50
50
  "lucide-react": "^1.16.0",
51
51
  "marked": "^18.0.4",
52
- "sanitize-html": "^2.17.4",
52
+ "sanitize-html": "^2.18.1",
53
53
  "tailwind-merge": "^3.6.0",
54
- "@ampless/mcp-server": "1.0.0-beta.69",
55
- "@ampless/plugin-og-image": "0.2.0-beta.62",
56
- "ampless": "1.0.0-beta.62"
54
+ "@ampless/mcp-server": "1.0.0-beta.70",
55
+ "@ampless/plugin-og-image": "0.2.0-beta.63",
56
+ "ampless": "1.0.0-beta.63"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "@aws-amplify/adapter-nextjs": "^1",