@salsita-ai/sdk 0.50.0-develop.ea458ea381 → 0.50.0-develop.f42416a4e6

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 (100) hide show
  1. package/README.md +19 -11
  2. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +3 -1
  3. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +39 -16
  4. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  5. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
  6. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  7. package/dist/configurator/assistant/use-assistant-chat.d.ts +15 -5
  8. package/dist/configurator/assistant/use-assistant-chat.js +1 -1
  9. package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
  10. package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
  11. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +11 -0
  12. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
  13. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
  14. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
  15. package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
  16. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
  17. package/dist/configurator/ui/assistant/AssistantPanelProvider.d.ts +42 -0
  18. package/dist/configurator/ui/assistant/AssistantPanelProvider.js +1 -0
  19. package/dist/configurator/ui/assistant/AssistantThread.d.ts +11 -0
  20. package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
  21. package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
  22. package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
  23. package/dist/configurator/ui/assistant/index.d.ts +2 -0
  24. package/dist/configurator/ui/assistant/index.js +1 -0
  25. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
  26. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
  27. package/dist/configurator/ui/assistant/theme.d.ts +2 -0
  28. package/dist/configurator/ui/assistant/theme.js +1 -0
  29. package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
  30. package/dist/configurator/ui/assistant/thread-items.js +1 -0
  31. package/dist/configurator/ui/assistant/tool-chip.d.ts +37 -0
  32. package/dist/configurator/ui/assistant/tool-chip.js +1 -0
  33. package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
  34. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
  35. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
  36. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  37. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
  38. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
  39. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
  40. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
  41. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
  42. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  43. package/dist/docs/index.json +1 -1
  44. package/dist/docs/layouts/toolbar.mdx +4 -0
  45. package/dist/docs/phoenix/admin.mdx +2 -2
  46. package/dist/docs/phoenix/finalization.mdx +1 -1
  47. package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
  48. package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
  49. package/dist/docs/phoenix/phoenix-cli.mdx +56 -18
  50. package/dist/docs/phoenix/project-structure.mdx +1 -1
  51. package/dist/docs/phoenix/sdk-builder-workflow.mdx +3 -2
  52. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
  53. package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
  54. package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
  55. package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
  56. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
  57. package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
  58. package/dist/i18n/locales/cs/messages.js +1 -1
  59. package/dist/i18n/locales/da/messages.js +1 -1
  60. package/dist/i18n/locales/de/messages.js +1 -1
  61. package/dist/i18n/locales/de-AT/messages.js +1 -1
  62. package/dist/i18n/locales/en/messages.js +1 -1
  63. package/dist/i18n/locales/en-AU/messages.js +1 -1
  64. package/dist/i18n/locales/en-GB/messages.js +1 -1
  65. package/dist/i18n/locales/es/messages.js +1 -1
  66. package/dist/i18n/locales/fr/messages.js +1 -1
  67. package/dist/i18n/locales/hu/messages.js +1 -1
  68. package/dist/i18n/locales/it/messages.js +1 -1
  69. package/dist/i18n/locales/nl/messages.js +1 -1
  70. package/dist/i18n/locales/pl/messages.js +1 -1
  71. package/dist/i18n/locales/pt/messages.js +1 -1
  72. package/dist/i18n/locales/ro/messages.js +1 -1
  73. package/dist/i18n/locales/sk/messages.js +1 -1
  74. package/dist/i18n/locales/tr/messages.js +1 -1
  75. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
  76. package/dist/phoenix/cli.js +1 -1
  77. package/dist/phoenix/commands/build.d.ts +5 -0
  78. package/dist/phoenix/commands/build.js +1 -1
  79. package/dist/phoenix/commands/deploy.js +2 -2
  80. package/dist/phoenix/commands/feedback.d.ts +2 -1
  81. package/dist/phoenix/commands/feedback.js +1 -1
  82. package/dist/phoenix/services/index.d.ts +1 -0
  83. package/dist/phoenix/services/index.js +1 -1
  84. package/dist/phoenix/services/phx-banner-plugin.d.ts +32 -0
  85. package/dist/phoenix/services/phx-banner-plugin.js +1 -0
  86. package/dist/phoenix/services/phx-licenses-plugin.d.ts +55 -0
  87. package/dist/phoenix/services/phx-licenses-plugin.js +8 -0
  88. package/dist/phoenix/services/vite-config.d.ts +2 -0
  89. package/dist/phoenix/services/vite-config.js +1 -1
  90. package/dist/phoenix/utils/index.d.ts +1 -0
  91. package/dist/phoenix/utils/index.js +1 -1
  92. package/dist/phoenix/utils/read-git-commit.d.ts +14 -0
  93. package/dist/phoenix/utils/read-git-commit.js +1 -0
  94. package/dist/ui-sdk/theme/types.d.ts +4 -0
  95. package/package.json +4 -7
  96. package/schema/domain-spec.json +24 -0
  97. package/dist/extras/assistant/AssistantChat.d.ts +0 -6
  98. package/dist/extras/assistant/AssistantChat.js +0 -1
  99. package/dist/extras/assistant/index.d.ts +0 -1
  100. package/dist/extras/assistant/index.js +0 -1
@@ -1 +1 @@
1
- import{lingui as e}from"@lingui/vite-plugin";import i from"@vitejs/plugin-react";import{mkdir as t,readFile as n,writeFile as r}from"fs/promises";import o from"lodash-es/camelCase.js";import{createRequire as a}from"node:module";import{dirname as s,resolve as m}from"path";import{createLogger as l}from"vite";import d from"vite-plugin-css-injected-by-js";import{isUsingLocalSdk as f}from"../utils/package-info.js";import{loadFrontendConfigModule as c}from"./frontend-config.js";import{phxCspNoncePlugin as p}from"./phx-csp-nonce-plugin.js";import{phxGlobalIsolationPlugin as g}from"./phx-global-isolation-plugin.js";let u=null;export const setViteLogSink=(e,i={})=>{u={sink:e,echo:i.echo??!1}};let h=["react","react-dom","three","@react-three/fiber","@react-three/drei","@react-three/postprocessing","its-fine","@emotion/react","@emotion/styled","@mui/material","@mui/system","@tanstack/react-query","rxjs"],S=e=>{let i=e.DEPLOYMENT_ID;if("string"!=typeof i)throw Error("DEPLOYMENT_ID is required in runtime config");return i};export const getViteDevConfig=async t=>{var n,r;let o,d,p=f(),y=c(),O=y.readRuntimeConfig(),b=y.frontendBuildConfig,D=Object.fromEntries((t?.templateFiles??[]).map(e=>[e,`.phoenix/${e}`]));return{...u&&{customLogger:(n=u.sink,r=u.echo,o=l(),{get hasWarned(){return o.hasWarned},info:(e,i)=>{n("info",e),r&&o.info(e,i)},warn:(e,i)=>{n("warn",e),r&&o.warn(e,i)},warnOnce:(e,i)=>{n("warn",e),r&&o.warnOnce(e,i)},error:(e,i)=>{n("error",e),r&&o.error(e,i)},clearScreen:e=>{r&&o.clearScreen(e)},hasErrorLogged:e=>o.hasErrorLogged(e)}),...u.echo?{}:{clearScreen:!1}},mode:"development",optimizeDeps:{exclude:["@swc/wasm-web"],...p&&{entries:["index.html","admin.html",...t?.templateFiles??[]],force:!0}},...p&&{resolve:{alias:(d=a(m(process.cwd(),"package.json")),h.flatMap(e=>{try{let i=s(d.resolve(`${e}/package.json`));return[{find:RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(/|$)`),replacement:`${i}$1`}]}catch{return[]}}))}},plugins:[i({babel:{plugins:["macros"]}}),e(),{name:"vite:runtime-config",apply:(e,i)=>"build"===i.command||"development"===i.mode,config:e=>{let i=y.readRuntimeConfig(),t=y.frontendBuildConfig;return{...e,define:{...e.define,"phx.frontendEnv":JSON.stringify(i),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(t.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(t.gltfDecoder)}}}},g({getDeploymentId:()=>S(y.readRuntimeConfig())})],define:{"process.env":{},"import.meta.env.DEV":!0,"import.meta.env.PROD":!1,"phx.frontendEnv":JSON.stringify(O),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(b.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(b.gltfDecoder)},build:{rollupOptions:{input:{index:".phoenix/index.html",admin:".phoenix/admin.html",...D}}},root:m(process.cwd(),"./.phoenix"),server:{watch:{ignored:["./**/*.{ts,tsx}","./.swc/**","../spec/**","../src/**"]}}}};export const getViteBuildConfigs=async a=>{let l=c(),f=l.readRuntimeConfig(),u=l.frontendBuildConfig,h=[{name:"salsita-configurator",entryFile:"./configurator.ts",mainScriptPath:"./configurator.ts",htmlFiles:["./index.html",...{templateFiles:a.templateFiles}.templateFiles],main:!0,format:"iife"},{name:"salsita-admin",entryFile:"./admin.ts",mainScriptPath:"./admin.ts",htmlFiles:["./admin.html"],main:!1,format:"iife"},{name:"salsita-embedded-admin",entryFile:"./embedded-admin.ts",mainScriptPath:"./embedded-admin.ts",htmlFiles:[],main:!1,format:"es"},{name:"salsita-embedded-configurator",entryFile:"./embedded-configurator.ts",mainScriptPath:"./embedded-configurator.ts",htmlFiles:[],main:!1,format:"es"}].map(c=>({plugins:[i({babel:{plugins:["macros"]}}),e(),d({useStrictCSP:!0}),p(),g({getDeploymentId:()=>S(l.readRuntimeConfig())}),{name:"vite:lib-index",writeBundle:async()=>{if(!c.htmlFiles.length)return;let e="iife"===c.format?`${c.name}.iife.js`:`${c.name}.js`;for(let i of c.htmlFiles){if(c.main&&a.enableEditor&&"./index.html"===i)continue;let o=m("./.phoenix",i),l=m("./.phoenix/dist/frontend",i);await t(s(l),{recursive:!0});let d=(await n(o,"utf-8")).replace(c.mainScriptPath,e);await r(l,d,"utf-8")}}}],build:{outDir:"./dist/frontend",chunkSizeWarningLimit:4e3,lib:{entry:c.entryFile,name:o(c.name),formats:[c.format],fileName:()=>"iife"===c.format?`${c.name}.iife.js`:`${c.name}.js`},rollupOptions:{external:[],output:{assetFileNames:`${c.name}.[ext]`}},minify:!0,emptyOutDir:!1},root:m(process.cwd(),"./.phoenix"),define:{"process.env":{},"process.env.NODE_ENV":JSON.stringify("production"),"phx.frontendEnv":JSON.stringify(f),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(u.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(u.gltfDecoder)}}));return a.enableEditor?[...h,{plugins:[i({babel:{plugins:["macros"]}}),e(),d({useStrictCSP:!0}),p()],build:{outDir:"./dist/frontend",chunkSizeWarningLimit:4e3,rollupOptions:{external:[]},minify:!0,emptyOutDir:!1},root:m(process.cwd(),"./.phoenix"),define:{"process.env":{},"process.env.NODE_ENV":JSON.stringify("production"),"phx.frontendEnv":JSON.stringify(f),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(u.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(u.gltfDecoder)}}]:h};
1
+ import{lingui as e}from"@lingui/vite-plugin";import i from"@vitejs/plugin-react";import{mkdir as t,readFile as n,writeFile as r}from"fs/promises";import o from"lodash-es/camelCase.js";import{createRequire as a}from"node:module";import{dirname as s,resolve as m}from"path";import{createLogger as l}from"vite";import d from"vite-plugin-css-injected-by-js";import{isUsingLocalSdk as f}from"../utils/package-info.js";import{loadFrontendConfigModule as p}from"./frontend-config.js";import{phxBannerPlugin as c}from"./phx-banner-plugin.js";import{phxCspNoncePlugin as g}from"./phx-csp-nonce-plugin.js";import{phxGlobalIsolationPlugin as u}from"./phx-global-isolation-plugin.js";import{phxLicensesPlugin as h}from"./phx-licenses-plugin.js";let S=null;export const setViteLogSink=(e,i={})=>{S={sink:e,echo:i.echo??!1}};let b=["react","react-dom","three","@react-three/fiber","@react-three/drei","@react-three/postprocessing","its-fine","@emotion/react","@emotion/styled","@mui/material","@mui/system","@tanstack/react-query","rxjs"],y=e=>{let i=e.DEPLOYMENT_ID;if("string"!=typeof i)throw Error("DEPLOYMENT_ID is required in runtime config");return i};export const getViteDevConfig=async t=>{var n,r;let o,d,c=f(),g=p(),h=g.readRuntimeConfig(),O=g.frontendBuildConfig,x=Object.fromEntries((t?.templateFiles??[]).map(e=>[e,`.phoenix/${e}`]));return{...S&&{customLogger:(n=S.sink,r=S.echo,o=l(),{get hasWarned(){return o.hasWarned},info:(e,i)=>{n("info",e),r&&o.info(e,i)},warn:(e,i)=>{n("warn",e),r&&o.warn(e,i)},warnOnce:(e,i)=>{n("warn",e),r&&o.warnOnce(e,i)},error:(e,i)=>{n("error",e),r&&o.error(e,i)},clearScreen:e=>{r&&o.clearScreen(e)},hasErrorLogged:e=>o.hasErrorLogged(e)}),...S.echo?{}:{clearScreen:!1}},mode:"development",optimizeDeps:{exclude:["@swc/wasm-web"],...c&&{entries:["index.html","admin.html",...t?.templateFiles??[]],force:!0}},...c&&{resolve:{alias:(d=a(m(process.cwd(),"package.json")),b.flatMap(e=>{try{let i=s(d.resolve(`${e}/package.json`));return[{find:RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(/|$)`),replacement:`${i}$1`}]}catch{return[]}}))}},plugins:[i({babel:{plugins:["macros"]}}),e(),{name:"vite:runtime-config",apply:(e,i)=>"build"===i.command||"development"===i.mode,config:e=>{let i=g.readRuntimeConfig(),t=g.frontendBuildConfig;return{...e,define:{...e.define,"phx.frontendEnv":JSON.stringify(i),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(t.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(t.gltfDecoder)}}}},u({getDeploymentId:()=>y(g.readRuntimeConfig())})],define:{"process.env":{},"import.meta.env.DEV":!0,"import.meta.env.PROD":!1,"phx.frontendEnv":JSON.stringify(h),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(O.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(O.gltfDecoder)},build:{rollupOptions:{input:{index:".phoenix/index.html",admin:".phoenix/admin.html",...x}}},root:m(process.cwd(),"./.phoenix"),server:{watch:{ignored:["./**/*.{ts,tsx}","./.swc/**","../spec/**","../src/**"]}}}};export const getViteBuildConfigs=async a=>{let l=p(),f=l.readRuntimeConfig(),S=l.frontendBuildConfig,b=h(),O=c({sdkVersion:a.sdkVersion,banner:a.banner}),x=[{name:"salsita-configurator",entryFile:"./configurator.ts",mainScriptPath:"./configurator.ts",htmlFiles:["./index.html",...{templateFiles:a.templateFiles}.templateFiles],main:!0,format:"iife"},{name:"salsita-admin",entryFile:"./admin.ts",mainScriptPath:"./admin.ts",htmlFiles:["./admin.html"],main:!1,format:"iife"},{name:"salsita-embedded-admin",entryFile:"./embedded-admin.ts",mainScriptPath:"./embedded-admin.ts",htmlFiles:[],main:!1,format:"es"},{name:"salsita-embedded-configurator",entryFile:"./embedded-configurator.ts",mainScriptPath:"./embedded-configurator.ts",htmlFiles:[],main:!1,format:"es"}].map(p=>({plugins:[i({babel:{plugins:["macros"]}}),e(),d({useStrictCSP:!0}),g(),u({getDeploymentId:()=>y(l.readRuntimeConfig())}),{name:"vite:lib-index",writeBundle:async()=>{if(!p.htmlFiles.length)return;let e="iife"===p.format?`${p.name}.iife.js`:`${p.name}.js`;for(let i of p.htmlFiles){if(p.main&&a.enableEditor&&"./index.html"===i)continue;let o=m("./.phoenix",i),l=m("./.phoenix/dist/frontend",i);await t(s(l),{recursive:!0});let d=(await n(o,"utf-8")).replace(p.mainScriptPath,e);await r(l,d,"utf-8")}}},b,O],build:{outDir:"./dist/frontend",chunkSizeWarningLimit:4e3,lib:{entry:p.entryFile,name:o(p.name),formats:[p.format],fileName:()=>"iife"===p.format?`${p.name}.iife.js`:`${p.name}.js`},rollupOptions:{external:[],output:{assetFileNames:`${p.name}.[ext]`}},minify:!0,emptyOutDir:!1},root:m(process.cwd(),"./.phoenix"),define:{"process.env":{},"process.env.NODE_ENV":JSON.stringify("production"),"phx.frontendEnv":JSON.stringify(f),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(S.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(S.gltfDecoder)}}));return a.enableEditor?[...x,{plugins:[i({babel:{plugins:["macros"]}}),e(),d({useStrictCSP:!0}),g(),b,O],build:{outDir:"./dist/frontend",chunkSizeWarningLimit:4e3,rollupOptions:{external:[]},minify:!0,emptyOutDir:!1},root:m(process.cwd(),"./.phoenix"),define:{"process.env":{},"process.env.NODE_ENV":JSON.stringify("production"),"phx.frontendEnv":JSON.stringify(f),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(S.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(S.gltfDecoder)}}]:x};
@@ -7,5 +7,6 @@ export { FileLogger } from './file-logger.js';
7
7
  export { type Logger, type CreateLoggerOptions, createLogger } from './logger.js';
8
8
  export { addWorkspaceOverrides, ensureWorkspaceInstallSettings, getLocalOverrides, getSdkPackages, getWorkspaceDir, hasLocalOverrides, readPackageJson, removeWorkspaceOverrides, } from './package-info.js';
9
9
  export { toPascalCase } from './pascal-case.js';
10
+ export { readGitCommit } from './read-git-commit.js';
10
11
  export { type RunCommandProps, runCommand } from './run-command.js';
11
12
  export { type FileUploadInfo, type UploadLinksData, uploadFilesWithPresignedUrls, readUploadLinks, } from './upload-utils.js';
@@ -1 +1 @@
1
- export{askQuestion}from"./ask-question.js";export{checkBundleSizeBudgets}from"./check-bundle-size-budgets.js";export{formatEnvContent,formatEnvLine}from"./env-file.js";export{parseChangelog,getLatestVersion,getVersion,paginateVersions,getVersionNumbers}from"./changelog-parser.js";export{createDirectoryFromYaml,exists,scanFolderForFiles,syncChangedFiles,syncExistingFolders,validateFolders,writeFileIfNotExists,writeFilesIfNotExists,writeRawFiles}from"./file-system.js";export{FileLogger}from"./file-logger.js";export{createLogger}from"./logger.js";export{addWorkspaceOverrides,ensureWorkspaceInstallSettings,getLocalOverrides,getSdkPackages,getWorkspaceDir,hasLocalOverrides,readPackageJson,removeWorkspaceOverrides}from"./package-info.js";export{toPascalCase}from"./pascal-case.js";export{runCommand}from"./run-command.js";export{uploadFilesWithPresignedUrls,readUploadLinks}from"./upload-utils.js";
1
+ export{askQuestion}from"./ask-question.js";export{checkBundleSizeBudgets}from"./check-bundle-size-budgets.js";export{formatEnvContent,formatEnvLine}from"./env-file.js";export{parseChangelog,getLatestVersion,getVersion,paginateVersions,getVersionNumbers}from"./changelog-parser.js";export{createDirectoryFromYaml,exists,scanFolderForFiles,syncChangedFiles,syncExistingFolders,validateFolders,writeFileIfNotExists,writeFilesIfNotExists,writeRawFiles}from"./file-system.js";export{FileLogger}from"./file-logger.js";export{createLogger}from"./logger.js";export{addWorkspaceOverrides,ensureWorkspaceInstallSettings,getLocalOverrides,getSdkPackages,getWorkspaceDir,hasLocalOverrides,readPackageJson,removeWorkspaceOverrides}from"./package-info.js";export{toPascalCase}from"./pascal-case.js";export{readGitCommit}from"./read-git-commit.js";export{runCommand}from"./run-command.js";export{uploadFilesWithPresignedUrls,readUploadLinks}from"./upload-utils.js";
@@ -0,0 +1,14 @@
1
+ export interface ReadGitCommitProps {
2
+ readonly directory: string;
3
+ /**
4
+ * A file of the project, relative to `directory`, that its repository tracks. git looks for a repository in every
5
+ * parent folder, so sources unpacked inside an unrelated checkout would otherwise report that checkout's commit.
6
+ */
7
+ readonly trackedFile: string;
8
+ }
9
+ /**
10
+ * Full SHA of the commit checked out in the project's own repository. Undefined when git cannot read one: no
11
+ * checkout, git missing or refusing the repository, no commit yet, or the project is not tracked by the repository
12
+ * around it. That is normal for a build from uploaded sources.
13
+ */
14
+ export declare const readGitCommit: (props: ReadGitCommitProps) => Promise<string | undefined>;
@@ -0,0 +1 @@
1
+ import{execFile as t}from"node:child_process";import{promisify as e}from"node:util";let r=e(t),i=/^[0-9a-f]{40,64}$/;export const readGitCommit=async t=>{let e={cwd:t.directory,timeout:5e3,windowsHide:!0};try{await r("git",["ls-files","--error-unmatch","--",t.trackedFile],e);let{stdout:o}=await r("git",["rev-parse","HEAD"],e),a=o.trim();return i.test(a)?a:void 0}catch{return}};
@@ -44,6 +44,7 @@ declare module '@mui/material/styles' {
44
44
  PhxChat: 'root';
45
45
  PhxChatFooter: 'root' | 'formLayout' | 'input';
46
46
  PhxChatMessage: 'base' | 'assistant' | 'user' | 'widget' | 'error' | 'helper';
47
+ PhxAssistantPanel: 'root' | 'header' | 'title' | 'closeButton' | 'thread' | 'greeting' | 'messages' | 'userMessage' | 'assistantMessage' | 'chips' | 'activity' | 'activityIcon' | 'chip' | 'status' | 'notice' | 'newReplyButton' | 'composer' | 'inputFrame' | 'input' | 'sendButton' | 'stopButton' | 'hint';
47
48
  PhxTopNavigation: 'root' | 'stepper' | 'step';
48
49
  PhxListSelector: 'root';
49
50
  PhxListSelectorItem: 'root' | 'radio' | 'title' | 'description' | 'formControlLabel';
@@ -109,6 +110,9 @@ declare module '@mui/material/styles' {
109
110
  PhxChatMessage?: {
110
111
  styleOverrides?: ComponentsOverrides<Theme>['PhxChatMessage'];
111
112
  };
113
+ PhxAssistantPanel?: {
114
+ styleOverrides?: ComponentsOverrides<Theme>['PhxAssistantPanel'];
115
+ };
112
116
  PhxPreviewLayout?: {
113
117
  styleOverrides?: ComponentsOverrides<Theme>['PhxPreviewLayout'];
114
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salsita-ai/sdk",
3
- "version": "0.50.0-develop.ea458ea381",
3
+ "version": "0.50.0-develop.f42416a4e6",
4
4
  "description": "TypeScript SDK and CLI for building, running, and deploying Phoenix configurator applications.",
5
5
  "keywords": [
6
6
  "salsita",
@@ -149,10 +149,6 @@
149
149
  "import": "./dist/extras/ai-preview/index.js",
150
150
  "types": "./dist/extras/ai-preview/index.d.ts"
151
151
  },
152
- "./extras/assistant": {
153
- "import": "./dist/extras/assistant/index.js",
154
- "types": "./dist/extras/assistant/index.d.ts"
155
- },
156
152
  "./common/utils": {
157
153
  "import": "./dist/common/utils.js",
158
154
  "types": "./dist/common/utils.d.ts"
@@ -275,6 +271,7 @@
275
271
  "react-json-tree": "0.20.0",
276
272
  "react-markdown": "9.0.1",
277
273
  "remark": "15.0.1",
274
+ "remark-gfm": "4.0.0",
278
275
  "rxjs": "7.8.2",
279
276
  "semver": "7.6.3",
280
277
  "spark-md5": "3.0.2",
@@ -295,8 +292,8 @@
295
292
  "yaml": "2.9.0",
296
293
  "yargs": "17.7.2",
297
294
  "zod": "3.25.76",
298
- "@salsita-ai/common": "0.50.0-develop.ea458ea381",
299
- "@salsita-ai/contracts": "0.50.0-develop.ea458ea381"
295
+ "@salsita-ai/contracts": "0.50.0-develop.f42416a4e6",
296
+ "@salsita-ai/common": "0.50.0-develop.f42416a4e6"
300
297
  },
301
298
  "devDependencies": {
302
299
  "@clerk/clerk-react": "5.61.8",
@@ -18586,6 +18586,30 @@
18586
18586
  "required": ["kind"],
18587
18587
  "additionalProperties": false
18588
18588
  },
18589
+ {
18590
+ "type": "object",
18591
+ "properties": {
18592
+ "kind": {
18593
+ "type": "string",
18594
+ "enum": ["assistantToolbarButton"]
18595
+ },
18596
+ "props": {
18597
+ "type": "object",
18598
+ "properties": {
18599
+ "showTitle": {
18600
+ "type": "boolean"
18601
+ },
18602
+ "icon": {
18603
+ "type": "string"
18604
+ }
18605
+ },
18606
+ "required": [],
18607
+ "additionalProperties": false
18608
+ }
18609
+ },
18610
+ "required": ["kind"],
18611
+ "additionalProperties": false
18612
+ },
18589
18613
  {
18590
18614
  "type": "object",
18591
18615
  "properties": {
@@ -1,6 +0,0 @@
1
- /**
2
- * Experimental, unstyled assistant chat for the current configuration: streamed replies, reasoning
3
- * summaries, tool calls with their payloads, a pending indicator and a stop button. It renders
4
- * nothing, and contacts no server, when the application spec has no `assistant` section.
5
- */
6
- export declare const AssistantChat: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Alert as r,Box as a,Button as i,LinearProgress as n,Stack as o,TextField as l,Typography as s}from"@mui/material";import{useState as c}from"react";import{useAssistantChat as p}from"#package/configurator";import{useSpecAssistant as m}from"#package/react-sdk";let d=({part:t})=>{switch(t.type){case"text":return e(s,{sx:{whiteSpace:"pre-wrap"},children:t.content});case"thinking":return e(s,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic",whiteSpace:"pre-wrap"},children:t.content});case"tool-call":return e(s,{variant:"caption",component:"pre",sx:{m:0,whiteSpace:"pre-wrap"},children:`${t.name}(${JSON.stringify(t.input??t.arguments)}) \xb7 ${t.state}`});case"tool-result":{let r=(e=>{if("string"!=typeof e){for(let t of e)if("image"===t.type&&"data"===t.source.type)return`data:${t.source.mimeType};base64,${t.source.value}`}})(t.content);return r?e(a,{component:"img",src:r,alt:"Tool result",sx:{maxWidth:"100%",border:1}}):e(s,{variant:"caption",children:`Tool result \xb7 ${t.state}`})}default:return null}},u=()=>{let{messages:m,send:u,stop:h,isLoading:f,error:x}=p(),[g,v]=c("");return t(o,{spacing:1.5,sx:{p:2},children:[m.map(r=>t(a,{component:"div",sx:{alignSelf:"user"===r.role?"flex-end":"flex-start",maxWidth:"85%"},children:[e(s,{variant:"overline",children:r.role}),r.parts.map((t,r)=>e(d,{part:t},r))]},r.id)),f&&e(n,{"aria-label":"Assistant is responding"}),x&&e(r,{severity:"warning",children:x.message}),e("form",{onSubmit:e=>{e.preventDefault();let t=g.trim();t&&(v(""),u(t))},children:t(o,{direction:"row",spacing:1,children:[e(l,{size:"small",fullWidth:!0,placeholder:"Ask the assistant…",value:g,onChange:e=>v(e.target.value)}),f?e(i,{onClick:()=>void h(),children:"Stop"}):e(i,{type:"submit",variant:"contained",disabled:!g.trim(),children:"Send"})]})})]})};export const AssistantChat=()=>m()?e(u,{}):null;
@@ -1 +0,0 @@
1
- export { AssistantChat } from './AssistantChat.js';
@@ -1 +0,0 @@
1
- export{AssistantChat}from"./AssistantChat.js";