@treasuryspatial/render-kit 0.1.1 → 0.1.2

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/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './render-api';
2
2
  export * from './render-prompt';
3
+ export * from './render-spec';
4
+ export * from './typekit';
3
5
  export * from './postcard';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './render-api';
2
2
  export * from './render-prompt';
3
+ export * from './render-spec';
4
+ export * from './typekit';
3
5
  export * from './postcard';
@@ -0,0 +1,24 @@
1
+ export type CourtyardRenderMode = 'imagine' | 'design' | 'map';
2
+ export declare const COURTYARD_TASKS: Record<CourtyardRenderMode, string>;
3
+ export type RenderSpecBlocks = {
4
+ task?: string;
5
+ form?: string;
6
+ view?: string;
7
+ style?: string;
8
+ program?: string;
9
+ context?: string;
10
+ };
11
+ export type BuildRenderSpecArgs = {
12
+ blocks: RenderSpecBlocks;
13
+ taskEnabled?: boolean;
14
+ };
15
+ export declare const buildCourtyardTaskBlock: (mode?: CourtyardRenderMode) => string;
16
+ export declare const buildRenderSpec: ({ blocks, taskEnabled }: BuildRenderSpecArgs) => string;
17
+ export declare const buildUserPromptBlock: (prompt: string) => string;
18
+ export declare const buildAdaptDeltaBlock: (prompt: string) => string;
19
+ export declare const buildCompositePrompt: ({ renderSpec, userPrompt, adaptDelta, }: {
20
+ renderSpec?: string;
21
+ userPrompt?: string;
22
+ adaptDelta?: string;
23
+ }) => string;
24
+ //# sourceMappingURL=render-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-spec.d.ts","sourceRoot":"","sources":["../src/render-spec.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE/D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAsB/D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAM,mBAA8B,WAC3B,CAAC;AAElD,eAAO,MAAM,eAAe,GAAI,yBAAgC,mBAAmB,KAAG,MAMrF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MAIrD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MAIrD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,yCAIlC;IACD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,KAAG,MAQH,CAAC"}
@@ -0,0 +1,54 @@
1
+ export const COURTYARD_TASKS = {
2
+ imagine: [
3
+ '<task>',
4
+ 'Render a photorealistic architectural visualization of an urban courtyard development and the immediate adjacent urban context visible from the chosen viewpoint.',
5
+ 'Use the user prompt and feature blocks as the complete design brief; do not introduce unrelated subjects or typologies.',
6
+ 'Prioritize architectural realism, material credibility, and clear courtyard enclosure suitable for design review.',
7
+ '</task>',
8
+ ].join('\n'),
9
+ design: [
10
+ '<task>',
11
+ 'Render a photorealistic architectural visualization of an urban courtyard using the provided massing/line model as the primary geometry reference.',
12
+ 'Treat the massing as ground-truth for footprint, height, and courtyard enclosure; apply facade, roof, and program detail from the feature blocks and user prompt.',
13
+ 'Prioritize architectural realism, material credibility, and clear courtyard enclosure suitable for design review.',
14
+ '</task>',
15
+ ].join('\n'),
16
+ map: [
17
+ '<task>',
18
+ 'Render a photorealistic architectural visualization of an urban courtyard using the provided massing/line model as the primary geometry reference.',
19
+ 'Treat the massing as ground-truth for footprint, height, and courtyard enclosure; apply facade, roof, and program detail from the feature blocks and user prompt.',
20
+ 'Prioritize architectural realism, material credibility, and clear courtyard enclosure suitable for design review.',
21
+ '</task>',
22
+ ].join('\n'),
23
+ };
24
+ export const buildCourtyardTaskBlock = (mode = 'design') => COURTYARD_TASKS[mode] ?? COURTYARD_TASKS.design;
25
+ export const buildRenderSpec = ({ blocks, taskEnabled = true }) => {
26
+ const ordered = [blocks.task, blocks.form, blocks.view, blocks.style, blocks.program, blocks.context].filter((block, index) => (index === 0 ? taskEnabled && Boolean(block) : Boolean(block)));
27
+ if (!ordered.length)
28
+ return '';
29
+ return ['<render_spec>', ...ordered, '</render_spec>'].join('\n\n');
30
+ };
31
+ export const buildUserPromptBlock = (prompt) => {
32
+ const trimmed = prompt?.trim();
33
+ if (!trimmed)
34
+ return '';
35
+ return ['<user_prompt>', trimmed, '</user_prompt>'].join('\n');
36
+ };
37
+ export const buildAdaptDeltaBlock = (prompt) => {
38
+ const trimmed = prompt?.trim();
39
+ if (!trimmed)
40
+ return '';
41
+ return ['<adapt_delta>', trimmed, '</adapt_delta>'].join('\n');
42
+ };
43
+ export const buildCompositePrompt = ({ renderSpec, userPrompt, adaptDelta, }) => {
44
+ const parts = [];
45
+ if (renderSpec)
46
+ parts.push(renderSpec);
47
+ const userBlock = buildUserPromptBlock(userPrompt ?? '');
48
+ if (userBlock)
49
+ parts.push(userBlock);
50
+ const deltaBlock = buildAdaptDeltaBlock(adaptDelta ?? '');
51
+ if (deltaBlock)
52
+ parts.push(deltaBlock);
53
+ return parts.filter(Boolean).join('\n\n');
54
+ };
@@ -0,0 +1,33 @@
1
+ import type { RenderSpecBlocks } from './render-spec';
2
+ export type TypeKitPromptState = {
3
+ profileId?: string;
4
+ state: Record<string, unknown> | RenderSpecBlocks;
5
+ fullText?: string;
6
+ };
7
+ export type TypeKitComputeState = {
8
+ toolId: string;
9
+ manifestVersion?: string;
10
+ parameters?: Record<string, unknown>;
11
+ };
12
+ export type TypeKitRenderState = {
13
+ presetId?: string;
14
+ overrides?: Record<string, unknown>;
15
+ };
16
+ export type TypeKitMapState = {
17
+ presetId?: string;
18
+ footprint?: Record<string, unknown>;
19
+ };
20
+ export type TypeKitStorageState = {
21
+ surfaceRecordId?: string;
22
+ policyId?: string;
23
+ };
24
+ export type TypeKitPayload = {
25
+ typekitId?: string;
26
+ typekitVersion?: string;
27
+ prompt: TypeKitPromptState;
28
+ compute?: TypeKitComputeState;
29
+ render?: TypeKitRenderState;
30
+ map?: TypeKitMapState;
31
+ storage?: TypeKitStorageState;
32
+ };
33
+ //# sourceMappingURL=typekit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typekit.d.ts","sourceRoot":"","sources":["../src/typekit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasuryspatial/render-kit",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",