@ankhorage/studio 2.6.4 → 2.7.1
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.md +1 -1
- package/apm/update.json +1 -1
- package/dist/authSettings.d.ts +5 -3
- package/dist/authSettings.d.ts.map +1 -1
- package/dist/authSettings.js +61 -49
- package/dist/authSettings.js.map +1 -1
- package/dist/cli/index.js +4 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/core/studioManifestDraftModel.d.ts.map +1 -1
- package/dist/core/studioManifestDraftModel.js +9 -2
- package/dist/core/studioManifestDraftModel.js.map +1 -1
- package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.d.ts +4 -0
- package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.d.ts.map +1 -0
- package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.js +22 -0
- package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.js.map +1 -0
- package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.d.ts +4 -0
- package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.d.ts.map +1 -0
- package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.js +36 -0
- package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.js.map +1 -0
- package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.d.ts +27 -0
- package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.d.ts.map +1 -0
- package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.js +67 -0
- package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.js.map +1 -0
- package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.d.ts +29 -0
- package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.d.ts.map +1 -0
- package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.js +116 -0
- package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.js.map +1 -0
- package/dist/features/projects/composition/createProjectGenerationStateStore.d.ts +4 -0
- package/dist/features/projects/composition/createProjectGenerationStateStore.d.ts.map +1 -0
- package/dist/features/projects/composition/createProjectGenerationStateStore.js +6 -0
- package/dist/features/projects/composition/createProjectGenerationStateStore.js.map +1 -0
- package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.d.ts +4 -0
- package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.d.ts.map +1 -0
- package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.js +17 -0
- package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.js.map +1 -0
- package/dist/host/auth/projectAuthHealthService.d.ts +3 -4
- package/dist/host/auth/projectAuthHealthService.d.ts.map +1 -1
- package/dist/host/auth/projectAuthHealthService.js +14 -12
- package/dist/host/auth/projectAuthHealthService.js.map +1 -1
- package/dist/host/auth/projectAuthRuntimeDiagnostics.d.ts +10 -23
- package/dist/host/auth/projectAuthRuntimeDiagnostics.d.ts.map +1 -1
- package/dist/host/auth/projectAuthRuntimeDiagnostics.js +54 -118
- package/dist/host/auth/projectAuthRuntimeDiagnostics.js.map +1 -1
- package/dist/host/createStudioHost.d.ts +3 -3
- package/dist/host/createStudioHost.d.ts.map +1 -1
- package/dist/host/createStudioHost.js +3 -6
- package/dist/host/createStudioHost.js.map +1 -1
- package/dist/host/http/projectRuntimeRoutes.d.ts +2 -4
- package/dist/host/http/projectRuntimeRoutes.d.ts.map +1 -1
- package/dist/host/http/projectRuntimeRoutes.js +25 -44
- package/dist/host/http/projectRuntimeRoutes.js.map +1 -1
- package/dist/host/http/server.d.ts.map +1 -1
- package/dist/host/http/server.js +5 -91
- package/dist/host/http/server.js.map +1 -1
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js.map +1 -1
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js +2 -2
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -1
- package/dist/host/layout/layoutGenerator.d.ts.map +1 -1
- package/dist/host/layout/layoutGenerator.js +17 -13
- package/dist/host/layout/layoutGenerator.js.map +1 -1
- package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js +1 -1
- package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js.map +1 -1
- package/dist/host/media/projectMediaStorage.d.ts +1 -1
- package/dist/host/media/projectMediaStorage.d.ts.map +1 -1
- package/dist/host/media/projectMediaStorage.js +19 -28
- package/dist/host/media/projectMediaStorage.js.map +1 -1
- package/dist/host/orchestrator/moduleManager.js +3 -3
- package/dist/host/orchestrator/moduleManager.js.map +1 -1
- package/dist/host/orchestrator/projectManager.d.ts +21 -21
- package/dist/host/orchestrator/projectManager.d.ts.map +1 -1
- package/dist/host/orchestrator/projectManager.js +97 -63
- package/dist/host/orchestrator/projectManager.js.map +1 -1
- package/dist/host/orchestrator/studioInfraUp.d.ts +5 -11
- package/dist/host/orchestrator/studioInfraUp.d.ts.map +1 -1
- package/dist/host/orchestrator/studioInfraUp.js +8 -36
- package/dist/host/orchestrator/studioInfraUp.js.map +1 -1
- package/dist/host/secrets/projectSecretService.d.ts +2 -3
- package/dist/host/secrets/projectSecretService.d.ts.map +1 -1
- package/dist/host/secrets/projectSecretService.js +24 -46
- package/dist/host/secrets/projectSecretService.js.map +1 -1
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.d.ts +3 -5
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.d.ts.map +1 -1
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.js +4 -11
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.js.map +1 -1
- package/dist/host/secrets/trustedOAuthInfraEnvironment.d.ts.map +1 -1
- package/dist/host/secrets/trustedOAuthInfraEnvironment.js +2 -2
- package/dist/host/secrets/trustedOAuthInfraEnvironment.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/manifestState.d.ts.map +1 -1
- package/dist/manifestState.js +13 -8
- package/dist/manifestState.js.map +1 -1
- package/dist/manifestSync.js +1 -1
- package/dist/manifestSync.js.map +1 -1
- package/dist/projectAuthApi.d.ts +2 -2
- package/dist/projectAuthApi.d.ts.map +1 -1
- package/dist/projectAuthApi.js +6 -6
- package/dist/projectAuthApi.js.map +1 -1
- package/dist/projectAuthHealth.d.ts +4 -3
- package/dist/projectAuthHealth.d.ts.map +1 -1
- package/dist/projectAuthHealth.js +8 -6
- package/dist/projectAuthHealth.js.map +1 -1
- package/dist/projectAuthRuntimeDiagnostics.d.ts +2 -1
- package/dist/projectAuthRuntimeDiagnostics.d.ts.map +1 -1
- package/dist/projectAuthRuntimeDiagnostics.js.map +1 -1
- package/dist/projectDeployRuntimeInput.d.ts +2 -2
- package/dist/projectDeployRuntimeInput.d.ts.map +1 -1
- package/dist/projectOAuthSetup.d.ts +4 -3
- package/dist/projectOAuthSetup.d.ts.map +1 -1
- package/dist/projectOAuthSetup.js +3 -2
- package/dist/projectOAuthSetup.js.map +1 -1
- package/dist/projectSecretUsage.js +17 -16
- package/dist/projectSecretUsage.js.map +1 -1
- package/dist/types/project-generation.d.ts +11 -0
- package/dist/types/project-generation.d.ts.map +1 -0
- package/dist/types/project-generation.js +2 -0
- package/dist/types/project-generation.js.map +1 -0
- package/dist/ui/admin/pages/AuthAdminPage.d.ts.map +1 -1
- package/dist/ui/admin/pages/AuthAdminPage.js +21 -10
- package/dist/ui/admin/pages/AuthAdminPage.js.map +1 -1
- package/dist/ui/admin/pages/OverviewAdminPage.js +1 -1
- package/dist/ui/admin/pages/OverviewAdminPage.js.map +1 -1
- package/dist/ui/admin/pages/adminAuthCredentialFlow.js +0 -1
- package/dist/ui/admin/pages/adminAuthCredentialFlow.js.map +1 -1
- package/dist/ui/admin/pages/deploy/DeployMonetizationSyncCard.d.ts.map +1 -1
- package/dist/ui/admin/pages/deploy/DeployMonetizationSyncCard.js +2 -2
- package/dist/ui/admin/pages/deploy/DeployMonetizationSyncCard.js.map +1 -1
- package/dist/ui/admin/pages/deploy/DeployReleaseOperationsCard.d.ts.map +1 -1
- package/dist/ui/admin/pages/deploy/DeployReleaseOperationsCard.js +2 -2
- package/dist/ui/admin/pages/deploy/DeployReleaseOperationsCard.js.map +1 -1
- package/package.json +8 -5
- package/dist/host/orchestrator/infraSession.d.ts +0 -31
- package/dist/host/orchestrator/infraSession.d.ts.map +0 -1
- package/dist/host/orchestrator/infraSession.js +0 -79
- package/dist/host/orchestrator/infraSession.js.map +0 -1
- package/dist/host/orchestrator/projectGenerationState.d.ts +0 -11
- package/dist/host/orchestrator/projectGenerationState.d.ts.map +0 -1
- package/dist/host/orchestrator/projectGenerationState.js +0 -65
- package/dist/host/orchestrator/projectGenerationState.js.map +0 -1
- package/dist/host/utils/trimOutput.d.ts +0 -11
- package/dist/host/utils/trimOutput.d.ts.map +0 -1
- package/dist/host/utils/trimOutput.js +0 -9
- package/dist/host/utils/trimOutput.js.map +0 -1
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { ensureProjectInfrastructureRuntime, InfraScriptExecutionError, resolveProjectInfrastructurePortForward, runProjectInfrastructureLifecycle, } from '@ankhorage/infra/project';
|
|
2
|
-
const portForwardSessions = new Map();
|
|
3
|
-
const defaultDependencies = {
|
|
4
|
-
ensureProjectInfrastructureRuntime,
|
|
5
|
-
resolveProjectInfrastructurePortForward,
|
|
6
|
-
runProjectInfrastructureLifecycle,
|
|
7
|
-
};
|
|
8
|
-
/***
|
|
9
|
-
* Ensure one generated project's Infrastructure runtime session is available and remember it for shutdown cleanup.
|
|
10
|
-
* @todo Move Studio Infrastructure-session orchestration out of generic `host/orchestrator` into the owning projects/infra host edge.
|
|
11
|
-
*/
|
|
12
|
-
export async function ensureProjectInfrastructureRuntimeSession(args, dependencies = defaultDependencies) {
|
|
13
|
-
try {
|
|
14
|
-
await dependencies.ensureProjectInfrastructureRuntime(args);
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
throw withInfrastructureUpGuidance(error, args.projectId);
|
|
18
|
-
}
|
|
19
|
-
portForwardSessions.set(sessionKey(args), args);
|
|
20
|
-
}
|
|
21
|
-
/***
|
|
22
|
-
* Resolve and ensure the web port-forward session required to launch a generated project.
|
|
23
|
-
* @todo Keep this Studio launch-session use case with project/infra application ownership rather than generic orchestration.
|
|
24
|
-
*/
|
|
25
|
-
export async function ensureProjectWebLaunchSession(args, dependencies = defaultDependencies) {
|
|
26
|
-
const endpoint = await dependencies.resolveProjectInfrastructurePortForward(args);
|
|
27
|
-
const status = await dependencies.runProjectInfrastructureLifecycle({
|
|
28
|
-
...args,
|
|
29
|
-
script: 'port-forward',
|
|
30
|
-
args: ['status', 'app'],
|
|
31
|
-
});
|
|
32
|
-
const started = !/\bapp:\s+running\b/u.test(status.stdout);
|
|
33
|
-
await ensureProjectInfrastructureRuntimeSession(args, dependencies);
|
|
34
|
-
return { started, url: endpoint.url };
|
|
35
|
-
}
|
|
36
|
-
/***
|
|
37
|
-
* Stop every remembered project Infrastructure port-forward while tolerating stale external sessions during shutdown.
|
|
38
|
-
* @todo Move global Studio Infrastructure shutdown coordination to the project/infra application edge.
|
|
39
|
-
*/
|
|
40
|
-
export async function stopAllProjectInfraPortForwards() {
|
|
41
|
-
const sessions = [...portForwardSessions.values()];
|
|
42
|
-
portForwardSessions.clear();
|
|
43
|
-
await Promise.all(sessions.map(async (session) => {
|
|
44
|
-
try {
|
|
45
|
-
await runProjectInfrastructureLifecycle({
|
|
46
|
-
...session,
|
|
47
|
-
script: 'port-forward',
|
|
48
|
-
args: ['stop', 'all'],
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
// Studio shutdown must not be blocked by a stale external runtime session.
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
/***
|
|
57
|
-
* Build a stable compound key from project path, project id, and target.
|
|
58
|
-
* @utility @ankhorage/utility/string
|
|
59
|
-
*/
|
|
60
|
-
function sessionKey(args) {
|
|
61
|
-
return `${args.projectPath}:${args.projectId}:${args.target}`;
|
|
62
|
-
}
|
|
63
|
-
/*** Preserve Infrastructure script diagnostics while appending the Studio-specific regeneration guidance. */
|
|
64
|
-
function withInfrastructureUpGuidance(error, projectId) {
|
|
65
|
-
const guidance = `Run Infrastructure Up to regenerate project '${projectId}' infrastructure before retrying.`;
|
|
66
|
-
if (error instanceof InfraScriptExecutionError) {
|
|
67
|
-
const guidedError = new InfraScriptExecutionError({
|
|
68
|
-
exitCode: error.exitCode,
|
|
69
|
-
message: `${error.message} ${guidance}`,
|
|
70
|
-
stderr: error.stderr,
|
|
71
|
-
stdout: error.stdout,
|
|
72
|
-
});
|
|
73
|
-
guidedError.cause = error;
|
|
74
|
-
return guidedError;
|
|
75
|
-
}
|
|
76
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
77
|
-
return new Error(`${message} ${guidance}`, { cause: error });
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=infraSession.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infraSession.js","sourceRoot":"","sources":["../../../src/host/orchestrator/infraSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,yBAAyB,EACzB,uCAAuC,EACvC,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAQlC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAA8B,CAAC;AAQlE,MAAM,mBAAmB,GAA6B;IACpD,kCAAkC;IAClC,uCAAuC;IACvC,iCAAiC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAC7D,IAAwB,EACxB,eAAyC,mBAAmB;IAE5D,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,kCAAkC,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,4BAA4B,CAAC,KAAK,EAAE,IAA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AAwB;IAC1C,OAAO,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;AAChE,CAAC;AAED,6GAA6G;AAC7G,SAAS,4BAA4B,CAAC,KAAc,EAAE,SAAiB;IACrE,MAAM,QAAQ,GAAG,gDAAgD,SAAS,mCAAmC,CAAC;IAC9G,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAI,yBAAyB,CAAC;YAChD,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,QAAQ,EAAE;YACvC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QACH,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,IAAI,KAAK,CAAC,GAAG,OAAO,IAAI,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Read whether the current generated project state includes the Studio admin surface.
|
|
3
|
-
* @todo Move generation-state persistence from generic `host/orchestrator` into the `projects/` generation domain.
|
|
4
|
-
*/
|
|
5
|
-
export declare function readProjectStudioInclusion(projectPath: string): Promise<boolean>;
|
|
6
|
-
/***
|
|
7
|
-
* Atomically persist whether the current generated project state includes the Studio admin surface.
|
|
8
|
-
* @todo Keep this domain wrapper in `projects/`; the generic atomic JSON write primitive can move to Utility.
|
|
9
|
-
*/
|
|
10
|
-
export declare function writeProjectStudioInclusion(projectPath: string, includeStudio: boolean): Promise<void>;
|
|
11
|
-
//# sourceMappingURL=projectGenerationState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectGenerationState.d.ts","sourceRoot":"","sources":["../../../src/host/orchestrator/projectGenerationState.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAItF;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { isMissingPathError, writeJsonFileAtomic } from '@ankhorage/utility/node/fs';
|
|
2
|
-
import { isRecord } from '@ankhorage/utility/object';
|
|
3
|
-
import { promises as fs } from 'fs';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
const PROJECT_GENERATION_STATE_REL_PATH = '.ankh/generation-state.json';
|
|
6
|
-
/***
|
|
7
|
-
* Read whether the current generated project state includes the Studio admin surface.
|
|
8
|
-
* @todo Move generation-state persistence from generic `host/orchestrator` into the `projects/` generation domain.
|
|
9
|
-
*/
|
|
10
|
-
export async function readProjectStudioInclusion(projectPath) {
|
|
11
|
-
const statePath = resolveProjectFile(projectPath, PROJECT_GENERATION_STATE_REL_PATH);
|
|
12
|
-
const state = await readProjectGenerationState(statePath);
|
|
13
|
-
return state.includeStudio;
|
|
14
|
-
}
|
|
15
|
-
/***
|
|
16
|
-
* Atomically persist whether the current generated project state includes the Studio admin surface.
|
|
17
|
-
* @todo Keep this domain wrapper in `projects/`; the generic atomic JSON write primitive can move to Utility.
|
|
18
|
-
*/
|
|
19
|
-
export async function writeProjectStudioInclusion(projectPath, includeStudio) {
|
|
20
|
-
const state = { includeStudio };
|
|
21
|
-
const statePath = resolveProjectFile(projectPath, PROJECT_GENERATION_STATE_REL_PATH);
|
|
22
|
-
await writeJsonFileAtomic(statePath, state);
|
|
23
|
-
}
|
|
24
|
-
/*** Read, parse, and validate the required Studio project-generation state document. */
|
|
25
|
-
async function readProjectGenerationState(statePath) {
|
|
26
|
-
let source;
|
|
27
|
-
try {
|
|
28
|
-
source = await fs.readFile(statePath, 'utf8');
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
if (isMissingPathError(error)) {
|
|
32
|
-
throw new Error(`Project generation state is missing at '${statePath}'. Run an explicit project sync with includeStudio set before using implicit runtime sync.`, { cause: error });
|
|
33
|
-
}
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
let parsed;
|
|
37
|
-
try {
|
|
38
|
-
parsed = JSON.parse(source);
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
throw new Error(`Project generation state is invalid at '${statePath}'.`, { cause: error });
|
|
42
|
-
}
|
|
43
|
-
if (!isProjectGenerationState(parsed)) {
|
|
44
|
-
throw new Error(`Project generation state is invalid at '${statePath}'.`);
|
|
45
|
-
}
|
|
46
|
-
return parsed;
|
|
47
|
-
}
|
|
48
|
-
/*** Validate the semantic shape of a persisted Studio project-generation state document. */
|
|
49
|
-
function isProjectGenerationState(value) {
|
|
50
|
-
return isRecord(value) && typeof value.includeStudio === 'boolean';
|
|
51
|
-
}
|
|
52
|
-
/***
|
|
53
|
-
* Resolve a relative path beneath a root and reject absolute or escaping paths.
|
|
54
|
-
* @utility @ankhorage/utility/node/path
|
|
55
|
-
*/
|
|
56
|
-
function resolveProjectFile(projectPath, relativePath) {
|
|
57
|
-
const root = path.resolve(projectPath);
|
|
58
|
-
const target = path.resolve(root, relativePath);
|
|
59
|
-
const relative = path.relative(root, target);
|
|
60
|
-
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
61
|
-
throw new Error(`Invalid project generation state path: ${relativePath}`);
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=projectGenerationState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectGenerationState.js","sourceRoot":"","sources":["../../../src/host/orchestrator/projectGenerationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAMxE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,WAAmB;IAClE,MAAM,SAAS,GAAG,kBAAkB,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC;IACrF,MAAM,KAAK,GAAG,MAAM,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,aAAa,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,WAAmB,EACnB,aAAsB;IAEtB,MAAM,KAAK,GAA2B,EAAE,aAAa,EAAE,CAAC;IACxD,MAAM,SAAS,GAAG,kBAAkB,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC;IACrF,MAAM,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,wFAAwF;AACxF,KAAK,UAAU,0BAA0B,CAAC,SAAiB;IACzD,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,2CAA2C,SAAS,4FAA4F,EAChJ,EAAE,KAAK,EAAE,K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|
|
4
|
-
originalLength: number;
|
|
5
|
-
}
|
|
6
|
-
/***
|
|
7
|
-
* Limit text to a maximum character count while preserving original length and appending a truncation marker when space permits.
|
|
8
|
-
* @utility @ankhorage/utility/string
|
|
9
|
-
*/
|
|
10
|
-
export declare function trimOutputForApi(text: string, maxChars: number): TrimmedOutput;
|
|
11
|
-
//# sourceMappingURL=trimOutput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trimOutput.d.ts","sourceRoot":"","sources":["../../../src/host/utils/trimOutput.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAE9E"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Limit text to a maximum character count while preserving original length and appending a truncation marker when space permits.
|
|
3
|
-
* @utility @ankhorage/utility/string
|
|
4
|
-
*/
|
|
5
|
-
export function trimOutputForApi(text, maxChars) {
|
|
6
|
-
return trimOutput(text, maxChars);
|
|
7
|
-
}
|
|
8
|
-
import { trimOutput } from '@ankhorage/utility/string';
|
|
9
|
-
//# sourceMappingURL=trimOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trimOutput.js","sourceRoot":"","sources":["../../../src/host/utils/trimOutput.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,QAAgB;IAC7D,OAAO,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACpC,CAAC;AACD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|