@osdk/integration-testing 0.1.0 → 0.1.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
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/CHANGELOG.md +13 -0
- package/build/browser/scripts/postinstall.js +6 -0
- package/build/browser/scripts/postinstall.js.map +1 -1
- package/build/browser/utils/empty-ontology-block.js +2 -0
- package/build/browser/utils/empty-ontology-block.js.map +1 -1
- package/build/cjs/index.cjs +2 -0
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/scripts/postinstall.js +6 -0
- package/build/esm/scripts/postinstall.js.map +1 -1
- package/build/esm/utils/empty-ontology-block.js +2 -0
- package/build/esm/utils/empty-ontology-block.js.map +1 -1
- package/build/types/scripts/postinstall.d.ts.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @osdk/integration-testing
|
|
2
2
|
|
|
3
|
+
## 0.1.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 54ed99f: Update postinstall script to skip installation when in development osdk-ts repo
|
|
8
|
+
- Updated dependencies [ab557b4]
|
|
9
|
+
- Updated dependencies [38c812b]
|
|
10
|
+
- @osdk/client@2.57.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
|
|
11
|
+
- @osdk/generator-converters.preview@0.35.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
|
|
12
|
+
- @osdk/seed-helpers@0.28.0-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
|
|
13
|
+
- @osdk/unit-testing@0.21.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
|
|
14
|
+
- @osdk/api@2.57.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73
|
|
15
|
+
|
|
3
16
|
## 0.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -18,7 +18,13 @@ import consola from "consola";
|
|
|
18
18
|
import invariant from "tiny-invariant";
|
|
19
19
|
import { checkFoundryCliVersion, MIN_FOUNDRY_CLI_VERSION } from "../utils/foundry-cli.js";
|
|
20
20
|
import { installFoundryCli } from "./download.js";
|
|
21
|
+
import { readGitRemoteUrl } from "./gitRemote.js";
|
|
21
22
|
export const postinstall = async () => {
|
|
23
|
+
const remote = await readGitRemoteUrl();
|
|
24
|
+
if (remote === "git@github.com:palantir/osdk-ts.git" || remote === "https://github.com/palantir/osdk-ts.git") {
|
|
25
|
+
consola.info(`✅ In osdk-ts repo, skipping installation.`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
22
28
|
const result = await checkFoundryCliVersion();
|
|
23
29
|
switch (result.type) {
|
|
24
30
|
case "installed":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","names":["consola","invariant","checkFoundryCliVersion","MIN_FOUNDRY_CLI_VERSION","installFoundryCli","
|
|
1
|
+
{"version":3,"file":"postinstall.js","names":["consola","invariant","checkFoundryCliVersion","MIN_FOUNDRY_CLI_VERSION","installFoundryCli","readGitRemoteUrl","postinstall","remote","info","result","type","version","warn","process","env","NODE_ENV"],"sources":["postinstall.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport consola from \"consola\";\nimport invariant from \"tiny-invariant\";\n\nimport {\n checkFoundryCliVersion,\n MIN_FOUNDRY_CLI_VERSION,\n} from \"../utils/foundry-cli.js\";\nimport { installFoundryCli } from \"./download.js\";\nimport { readGitRemoteUrl } from \"./gitRemote.js\";\n\nexport const postinstall = async (): Promise<void> => {\n const remote = await readGitRemoteUrl();\n if (\n remote === \"git@github.com:palantir/osdk-ts.git\" ||\n remote === \"https://github.com/palantir/osdk-ts.git\"\n ) {\n consola.info(`✅ In osdk-ts repo, skipping installation.`);\n return;\n }\n const result = await checkFoundryCliVersion();\n switch (result.type) {\n case \"installed\":\n consola.info(\n `✅ Foundry CLI (v${result.version}) is installed already, skipping installation.`,\n );\n return;\n case \"version-error\":\n consola.warn(\n `Foundry CLI is installed, but we could not probe its version.`,\n );\n return;\n case \"version-incompatible\":\n invariant(\n false,\n `Foundry CLI (v${result.version}) is installed already, but the minimum required version is ${MIN_FOUNDRY_CLI_VERSION}. Please run \"foundry update self\" to update foundry cli.`,\n );\n return;\n case \"not-found\":\n consola.info(`Foundry CLI not found locally, attempting to install...`);\n await installFoundryCli();\n return;\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,OAAO,MAAM,SAAS;AAC7B,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SACEC,sBAAsB,EACtBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,gBAAgB,QAAQ,gBAAgB;AAEjD,OAAO,MAAMC,WAAW,GAAG,MAAAA,CAAA,KAA2B;EACpD,MAAMC,MAAM,GAAG,MAAMF,gBAAgB,CAAC,CAAC;EACvC,IACEE,MAAM,KAAK,qCAAqC,IAChDA,MAAM,KAAK,yCAAyC,EACpD;IACAP,OAAO,CAACQ,IAAI,CAAC,2CAA2C,CAAC;IACzD;EACF;EACA,MAAMC,MAAM,GAAG,MAAMP,sBAAsB,CAAC,CAAC;EAC7C,QAAQO,MAAM,CAACC,IAAI;IACjB,KAAK,WAAW;MACdV,OAAO,CAACQ,IAAI,CACV,mBAAmBC,MAAM,CAACE,OAAO,gDACnC,CAAC;MACD;IACF,KAAK,eAAe;MAClBX,OAAO,CAACY,IAAI,CACV,+DACF,CAAC;MACD;IACF,KAAK,sBAAsB;MACzBC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAd,SAAS,QAEP,iBAAiBQ,MAAM,CAACE,OAAO,+DAA+DR,uBAAuB,2DAA2D,IAFlLF,SAAS;MAIT;IACF,KAAK,WAAW;MACdD,OAAO,CAACQ,IAAI,CAAC,yDAAyD,CAAC;MACvE,MAAMJ,iBAAiB,CAAC,CAAC;EAE7B;AACF,CAAC","ignoreList":[]}
|
|
@@ -46,11 +46,13 @@ export const EMPTY_ONTOLOGY_BLOCK_DATA = {
|
|
|
46
46
|
linkTypeIds: {},
|
|
47
47
|
linkTypes: {},
|
|
48
48
|
markings: {},
|
|
49
|
+
objectPropertyTypeIdsToRids: {},
|
|
49
50
|
objectTypeIds: {},
|
|
50
51
|
objectTypes: {},
|
|
51
52
|
propertyTypeIds: {},
|
|
52
53
|
propertyTypes: {},
|
|
53
54
|
sharedPropertyTypes: {},
|
|
55
|
+
structFieldRidsToApiNames: {},
|
|
54
56
|
timeSeriesSyncs: {},
|
|
55
57
|
valueTypes: {},
|
|
56
58
|
webhooks: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-ontology-block.js","names":["EMPTY_ONTOLOGY_BLOCK_DATA","objectTypes","sharedPropertyTypes","interfaceTypes","linkTypes","actionTypes","blockPermissionInformation","blockOutputCompassLocations","knownIdentifiers","actionParameterIds","actionParameters","datasourceColumns","datasources","filesDatasources","functions","geotimeSeriesSyncs","groupIds","interfaceActionTypeConstraints","interfaceLinkTypes","interfaceParameterConstraints","interfacePropertyTypes","linkTypeIds","markings","objectTypeIds","propertyTypeIds","propertyTypes","timeSeriesSyncs","valueTypes","webhooks","workshopModules","ruleSets"],"sources":["empty-ontology-block.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\n\ntype OntologyBlockDataV2 = Parameters<\n typeof PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData\n>[0];\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA: OntologyBlockDataV2 = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {},\n },\n ruleSets: {},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,MAAMA,yBAA8C,GAAG;EAC5DC,WAAW,EAAE,CAAC,CAAC;EACfC,mBAAmB,EAAE,CAAC,CAAC;EACvBC,cAAc,EAAE,CAAC,CAAC;EAClBC,SAAS,EAAE,CAAC,CAAC;EACbC,WAAW,EAAE,CAAC,CAAC;EACfC,0BAA0B,EAAE;IAC1BD,WAAW,EAAE,CAAC,CAAC;IACfJ,WAAW,EAAE,CAAC,CAAC;IACfG,SAAS,EAAE,CAAC,CAAC;IACbD,cAAc,EAAE,CAAC,CAAC;IAClBD,mBAAmB,EAAE,CAAC;EACxB,CAAC;EACDK,2BAA2B,EAAE,CAAC,CAAC;EAC/BC,gBAAgB,EAAE;IAChBC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,gBAAgB,EAAE,CAAC,CAAC;IACpBL,WAAW,EAAE,CAAC,CAAC;IACfM,iBAAiB,EAAE,CAAC,CAAC;IACrBC,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,SAAS,EAAE,CAAC,CAAC;IACbC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,QAAQ,EAAE,CAAC,CAAC;IACZC,8BAA8B,EAAE,CAAC,CAAC;IAClCC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,6BAA6B,EAAE,CAAC,CAAC;IACjCC,sBAAsB,EAAE,CAAC,CAAC;IAC1BjB,cAAc,EAAE,CAAC,CAAC;IAClBkB,WAAW,EAAE,CAAC,CAAC;IACfjB,SAAS,EAAE,CAAC,CAAC;IACbkB,QAAQ,EAAE,CAAC,CAAC;IACZC,aAAa,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"empty-ontology-block.js","names":["EMPTY_ONTOLOGY_BLOCK_DATA","objectTypes","sharedPropertyTypes","interfaceTypes","linkTypes","actionTypes","blockPermissionInformation","blockOutputCompassLocations","knownIdentifiers","actionParameterIds","actionParameters","datasourceColumns","datasources","filesDatasources","functions","geotimeSeriesSyncs","groupIds","interfaceActionTypeConstraints","interfaceLinkTypes","interfaceParameterConstraints","interfacePropertyTypes","linkTypeIds","markings","objectPropertyTypeIdsToRids","objectTypeIds","propertyTypeIds","propertyTypes","structFieldRidsToApiNames","timeSeriesSyncs","valueTypes","webhooks","workshopModules","ruleSets"],"sources":["empty-ontology-block.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\n\ntype OntologyBlockDataV2 = Parameters<\n typeof PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData\n>[0];\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA: OntologyBlockDataV2 = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectPropertyTypeIdsToRids: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n structFieldRidsToApiNames: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {},\n },\n ruleSets: {},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AC,CAAC;IAC7BC,eAAe,EAAE,CAAC,CAAC;IACnBC,UAAU,EAAE,CAAC,CAAC;IACdC,QAAQ,EAAE,CAAC,CAAC;IACZC,eAAe,EAAE,CAAC;EACpB,CAAC;EACDC,QAAQ,EAAE,CAAC;AACb,CAAC","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -707,11 +707,13 @@ var EMPTY_ONTOLOGY_BLOCK_DATA = {
|
|
|
707
707
|
linkTypeIds: {},
|
|
708
708
|
linkTypes: {},
|
|
709
709
|
markings: {},
|
|
710
|
+
objectPropertyTypeIdsToRids: {},
|
|
710
711
|
objectTypeIds: {},
|
|
711
712
|
objectTypes: {},
|
|
712
713
|
propertyTypeIds: {},
|
|
713
714
|
propertyTypes: {},
|
|
714
715
|
sharedPropertyTypes: {},
|
|
716
|
+
structFieldRidsToApiNames: {},
|
|
715
717
|
timeSeriesSyncs: {},
|
|
716
718
|
valueTypes: {},
|
|
717
719
|
webhooks: {},
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/createIntegrationClient.ts","../../src/cli-service/FoundryCliService.ts","../../src/utils/process.ts","../../src/utils/service.ts","../../src/cli-service/ServiceDiscoverer.ts","../../src/generated/cli/OntologySeedingService.ts","../../src/generated/cli/OntologySeedingService/setSeed.ts","../../src/generated/cli/StatusService.ts","../../src/generated/cli/StatusService/publishStatus.ts","../../src/generated/cli/StatusService/getStatus.ts","../../src/cli-service/StatusServer.ts","../../src/cli-service/CliServiceLauncher.ts","../../src/cli-service/OntologyServer.ts","../../src/createSeedClient.ts","../../src/utils/empty-ontology-block.ts","../../src/createIntegrationServer.ts","../../src/utils/foundry-cli.ts"],"names":["Agent","fs","undiciFetch","createClient","createMockClient","client","invariant","spawn","resolve","once","fs2","join","conjureFetch","path","setTimeout","isAbsolute","SeedBuilder","PreviewOntologyIrConverter","valid","gte","promisify","exec"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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AAAA,GACF;AACF;AC/FO,IAAM,uBAAA,GAA0B,SAAA;AACvC,IAAM,uBAAA,GAA0B,+DAAA;AAChC,IAAM,mBAAA,GAAsB,YAAU,MAAA,CAAO,IAAA,GAAO,KAAA,CAAM,uBAAuB,IAAI,CAAC,CAAA;AACtF,IAAM,kBAAA,GAAqB,CAAC,OAAA,EAAS,GAAA,KAAQY,aAAM,OAAO,CAAA,IAAK,IAAA,IAAQA,YAAA,CAAM,GAAG,CAAA,IAAK,IAAA,IAAQC,UAAA,CAAI,SAAS,GAAG,CAAA;AAC7G,IAAM,SAAA,GAAYC,eAAUC,kBAAI,CAAA;AACzB,IAAM,yBAAyB,MAAM;AAC1C,EAAA,OAAO,SAAA,CAAU,eAAe,CAAA,CAAE,IAAA,CAAK,MAAM,UAAU,mBAAmB,CAAC,CAAA,CAAE,IAAA,CAAK,CAAC;AAAA,IACjF;AAAA,GACF,KAAM;AACJ,IAAA,MAAM,OAAA,GAAU,oBAAoB,MAAM,CAAA;AAC1C,IAAA,IAAI,CAAC,SAAS,OAAO;AAAA,MACnB,IAAA,EAAM;AAAA,KACR;AACA,IAAA,MAAM,KAAA,GAAQ,kBAAA,CAAmB,OAAA,EAAS,uBAAuB,CAAA;AACjE,IAAA,IAAI,CAAC,OAAO,OAAO;AAAA,MACjB,IAAA,EAAM,sBAAA;AAAA,MACN;AAAA,KACF;AACA,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,WAAA;AAAA,MACN;AAAA,KACF;AAAA,EACF,CAAC,CAAA,CAAE,KAAA,CAAM,OAAO;AAAA,IACd,IAAA,EAAM;AAAA,GACR,CAAE,CAAA;AACJ","file":"index.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs/promises\";\nimport { createClient } from \"@osdk/client\";\nimport { createMockClient } from \"@osdk/unit-testing\";\nimport { fetch as undiciFetch, Agent } from \"undici\";\n\n/** The definition kinds accepted by {@link Client}'s call signatures. */\n\nexport async function createIntegrationClient(config) {\n const {\n baseUrl,\n metadata,\n caCertPath\n } = config;\n const agent = new Agent({\n connect: caCertPath ? {\n ca: await fs.readFile(caCertPath)\n } : {\n rejectUnauthorized: false\n }\n });\n const fetchWithCert = (input, init) => undiciFetch(input, {\n ...init,\n dispatcher: agent\n });\n const realClient = createClient(baseUrl, metadata.ontology.rid, () => Promise.resolve(\"integration-client-token\"), {}, fetchWithCert);\n const mockClient = createMockClient();\n const clientInternal = def => {\n switch (def.type) {\n case \"query\":\n return mockClient(def);\n case \"action\":\n return realClient(def);\n case \"interface\":\n return realClient(def);\n case \"object\":\n return realClient(def);\n case \"experiment\":\n default:\n return realClient(def);\n }\n };\n const client = Object.defineProperties(clientInternal, {\n ...Object.getOwnPropertyDescriptors(realClient),\n whenQuery: {\n value: mockClient.whenQuery.bind(undefined)\n },\n clearStubs: {\n value: mockClient.clearStubs.bind(undefined)\n }\n });\n return client;\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { spawn } from \"node:child_process\";\nimport { once } from \"node:events\";\nimport invariant from \"tiny-invariant\";\nconst MAX_CAPTURED_STDERR_CHUNKS = 32;\nexport const DEFAULT_READY_TIMEOUT_MS = 30_000;\nexport const DEFAULT_STOP_GRACE_MS = 5_000;\n\n/**\n * The shared collaborators a service needs to answer questions about itself.\n * Injected by the launcher via {@link FoundryCliService.attach} so services do\n * not have to construct — or know how to reach — either one.\n */\n\nconst TERMINAL_STATES = new Set([\"FAILED\", \"STOPPED\"]);\n\n/**\n * One Foundry CLI service subprocess.\n *\n * Subclasses supply the `foundry` subcommand to run and, where the default is\n * wrong, how to tell that the service is up.\n *\n * Dependencies are declared but not enforced here: a service names what it needs\n * and {@link CliServiceLauncher} is what orders and awaits them.\n */\nexport class FoundryCliService {\n #foundryCliPath;\n #projectPath;\n #child;\n #context;\n #stderr = [];\n #exit;\n constructor(name, config) {\n this.name = name;\n this.dependencies = config.dependencies ?? [];\n this.#foundryCliPath = config.foundryCliPath ?? \"foundry\";\n this.#projectPath = config.projectPath;\n }\n getProjectPath() {\n return this.#projectPath;\n }\n getCaCertPath() {\n return this.#context?.discoverer.get(this.name)?.caCertPath ?? undefined;\n }\n getUrl() {\n return this.#context?.discoverer.get(this.name)?.url;\n }\n getExitInfo() {\n if (this.#exit === undefined) {\n return undefined;\n }\n const {\n code,\n signal\n } = this.#exit;\n return signal ?? `code ${code}`;\n }\n getCapturedStderr() {\n return this.#stderr.join(\"\").trim();\n }\n getContext() {\n const context = this.#context;\n !(context !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${this.name} is not registered with a CliServiceLauncher, so it has ` + `no discoverer or status server to consult`) : invariant(false) : void 0;\n return context;\n }\n attach(context) {\n this.#context = context;\n }\n async start() {\n if (this.#child !== undefined) {\n return;\n }\n await this.getContext().discoverer.refresh();\n !!(await this.checkHealth()).ready ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${this.name} is already running; stop it before starting a new one`) : invariant(false) : void 0;\n await this.#spawn();\n }\n async #spawn() {\n this.#exit = undefined;\n this.#stderr = [];\n const child = spawn(this.#foundryCliPath, [...this.getArgs()], {\n cwd: this.#projectPath\n });\n this.#child = child;\n child.stderr.setEncoding(\"utf-8\");\n child.stderr.on(\"data\", chunk => {\n if (this.#stderr.push(chunk) > MAX_CAPTURED_STDERR_CHUNKS) {\n this.#stderr.shift();\n }\n });\n child.stdout.resume(); // flush, since we don't read from stdout\n child.on(\"exit\", (code, signal) => {\n this.#exit = {\n code,\n signal\n };\n });\n await new Promise((resolve, reject) => {\n child.once(\"spawn\", resolve);\n child.once(\"error\", error => reject(new Error(`Failed to spawn ${this.name} via ${this.#foundryCliPath}`, {\n cause: error\n })));\n });\n }\n async checkHealth() {\n const {\n discoverer,\n statusServer\n } = this.getContext();\n const discovery = discoverer.get(this.name);\n if (typeof discovery === \"undefined\") {\n return {\n service: this.name,\n state: \"UNDISCOVERED\",\n ready: false,\n terminal: false\n };\n }\n const status = await statusServer.getServiceStatus(this.name);\n const state = status?.status ?? \"DISCOVERED\";\n return {\n service: this.name,\n state,\n ready: state === \"READY\",\n terminal: TERMINAL_STATES.has(state),\n url: discovery.url,\n ...(status?.message != null ? {\n message: status.message\n } : {})\n };\n }\n\n /**\n * Signal the service and wait for the process to actually be gone.\n */\n async stop() {\n const child = this.#child;\n this.#child = undefined;\n if (child === undefined || child.exitCode != null || child.signalCode != null) {\n return;\n }\n const exited = once(child, \"exit\");\n child.kill(\"SIGINT\");\n const escalation = setTimeout(() => {\n child.kill(\"SIGKILL\");\n }, DEFAULT_STOP_GRACE_MS);\n try {\n await exited;\n } finally {\n clearTimeout(escalation);\n }\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const isProcessAlive = pid => {\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n // EPERM means the process exists but is owned by another user.\n return err.code === \"EPERM\";\n }\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst SERVICE_FILE_NAMES = {\n ONTOLOGY: \"ontology\",\n TYPESCRIPT_FUNCTIONS: \"typescript-functions\",\n PYTHON_FUNCTIONS: \"python-functions\",\n APP: \"app\",\n STATUS_SERVER: \"status-server\",\n PLATFORM_API_PROXY: \"platform-api-proxy\"\n};\nconst SERVICE_NAMES_BY_FILE_NAME = new Map(Object.entries(SERVICE_FILE_NAMES).map(([name, stem]) => [stem, name]));\nexport const serviceNameFromFileName = fileName => {\n const name = fileName.match(/^\\.?(?<name>.+)-discovery\\.json$/u)?.groups?.name;\n return name === undefined ? undefined : SERVICE_NAMES_BY_FILE_NAME.get(name);\n};\n\n/** The name a running service publishes its discovery record under. */\nexport const discoveryFileName = name => `.${SERVICE_FILE_NAMES[name]}-discovery.json`;","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as fs from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport { isProcessAlive } from \"../utils/process.js\";\nimport { serviceNameFromFileName } from \"../utils/service.js\";\n/**\n * Reads the discovery files that running Foundry services publish into\n * `basePath`.\n */\nexport class ServiceDiscoverer {\n #basePath;\n #discovered = new Map();\n constructor(args) {\n this.#basePath = args.basePath;\n }\n get discoveryDir() {\n return this.#basePath;\n }\n async start() {\n await fs.mkdir(this.#basePath, {\n recursive: true\n });\n await this.refresh();\n }\n\n /**\n * Re-read every discovery file in the directory.\n */\n async refresh() {\n const fileNames = await fs.readdir(this.#basePath);\n const discoveries = await Promise.all(fileNames.map(fileName => this.#read(fileName)));\n return discoveries.filter(discovery => discovery !== undefined);\n }\n get(name) {\n const discovery = this.#discovered.get(name);\n if (typeof discovery === \"undefined\") {\n return undefined;\n }\n if (!isProcessAlive(discovery.pid)) {\n this.#discovered.delete(name); // Stale: the publisher died without cleaning up after itself.\n return undefined;\n }\n return discovery;\n }\n isDiscovered(name) {\n return this.get(name) !== undefined;\n }\n all() {\n const live = new Map();\n for (const name of this.#discovered.keys()) {\n const discovery = this.get(name);\n if (discovery !== undefined) {\n live.set(name, discovery);\n }\n }\n return live;\n }\n stop() {\n this.#discovered.clear();\n }\n async #read(fileName) {\n const serviceName = serviceNameFromFileName(fileName);\n if (typeof serviceName === \"undefined\") {\n return undefined;\n }\n let contents;\n try {\n contents = await fs.readFile(join(this.#basePath, fileName), \"utf-8\");\n } catch {\n this.#discovered.delete(serviceName);\n return undefined;\n }\n let parsed;\n try {\n parsed = JSON.parse(contents);\n } catch {\n return undefined;\n }\n !parsed.url ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Service URL not found`) : invariant(false) : void 0;\n this.#discovered.set(serviceName, parsed);\n return parsed;\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nexport { setSeed } from \"./OntologySeedingService/setSeed.js\";","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nimport { conjureFetch } from \"conjure-lite\";\n/**\n * Sets the seed state of the local ontology server. Succeeds with an\n * empty `200` response; failures surface as errors: 400 for a malformed\n * request body, 503 while the server is still starting, and 500 (with\n * the underlying detail) for seeding failures.\n */\nexport async function setSeed(ctx, seed) {\n return conjureFetch(ctx, `/seed`, \"PUT\", seed);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nexport { publishStatus } from \"./StatusService/publishStatus.js\";\nexport { getStatus } from \"./StatusService/getStatus.js\";","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nimport { conjureFetch } from \"conjure-lite\";\n/**\n * Publish a lifecycle event. Called by services whenever a status\n * transition occurs.\n */\nexport async function publishStatus(ctx, status) {\n return conjureFetch(ctx, `/status`, \"POST\", status);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nimport { conjureFetch } from \"conjure-lite\";\n/**\n * Return the current status of all services.\n */\nexport async function getStatus(ctx) {\n return conjureFetch(ctx, `/status`, \"GET\");\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport { StatusService } from \"../generated/cli/index.js\";\nimport { FoundryCliService } from \"./FoundryCliService.js\";\nconst HEALTH_REQUEST_TIMEOUT_MS = 2_000;\n/**\n * The local status server, and the health authority for every other service.\n */\nexport class StatusServer extends FoundryCliService {\n /** Shared by callers that ask while a fetch is already outstanding. */\n #inFlight;\n constructor(config) {\n super(\"STATUS_SERVER\", config);\n }\n getArgs() {\n // force project path to cwd\n return [\"start\", \"status-server\", \"--discovery-path\", path.resolve(this.getProjectPath(), \".palantir\")];\n }\n async checkHealth() {\n const discovery = this.getContext().discoverer.get(\"STATUS_SERVER\");\n if (discovery === undefined) {\n return {\n service: \"STATUS_SERVER\",\n state: \"UNDISCOVERED\",\n ready: false,\n terminal: false\n };\n }\n const healthy = await this.#isHealthy(discovery.url);\n return {\n service: \"STATUS_SERVER\",\n state: healthy ? \"READY\" : \"DISCOVERED\",\n ready: healthy,\n terminal: false,\n url: discovery.url\n };\n }\n async #isHealthy(baseUrl) {\n try {\n const response = await fetch(new URL(\"/api/health\", baseUrl), {\n signal: AbortSignal.timeout(HEALTH_REQUEST_TIMEOUT_MS)\n });\n if (!response.ok) {\n return false;\n }\n const body = await response.json();\n return body.status === \"healthy\";\n } catch {\n return false;\n }\n }\n\n /**\n * The lifecycle snapshot for every service.\n */\n async getServiceStatuses() {\n const baseUrl = this.getContext().discoverer.get(\"STATUS_SERVER\")?.url;\n !baseUrl ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Cannot get service status because the status server is not discovered yet\") : invariant(false) : void 0;\n this.#inFlight ??= StatusService.getStatus({\n baseUrl,\n servicePath: \"\"\n }).catch(() => undefined).finally(() => {\n this.#inFlight = undefined;\n });\n const result = await this.#inFlight;\n return result ?? [];\n }\n async getServiceStatus(name) {\n const statuses = await this.getServiceStatuses();\n return statuses.find(({\n service\n }) => service === name);\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"node:path\";\nimport { setTimeout } from \"node:timers/promises\";\nimport invariant from \"tiny-invariant\";\nimport { DEFAULT_READY_TIMEOUT_MS } from \"./FoundryCliService.js\";\nimport { ServiceDiscoverer } from \"./ServiceDiscoverer.js\";\nimport { StatusServer } from \"./StatusServer.js\";\nconst HEALTH_POLL_INTERVAL_MS = 200;\n/**\n * Brings a set of Foundry services. Includes a status server by default.\n */\nexport class CliServiceLauncher {\n #discoverer;\n #statusServer;\n #services = new Map();\n\n /** Memoized in-flight starts, so a shared dependency is started once. */\n #starts = new Map();\n #started = false;\n constructor(config = {}) {\n const projectDir = config.projectDir ?? process.cwd();\n this.#discoverer = new ServiceDiscoverer({\n basePath: path.resolve(projectDir, \".palantir\")\n });\n this.#statusServer = config.statusServer ?? new StatusServer({\n projectPath: projectDir,\n foundryCliPath: config.foundryCliPath\n });\n this.register(this.#statusServer);\n }\n get services() {\n return [...this.#services.values()];\n }\n get(name) {\n return this.#services.get(name);\n }\n register(service) {\n const existing = this.#services.get(service.name);\n if (existing === service) {\n return service;\n }\n !(existing === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `A different ${service.name} service is already registered`) : invariant(false) : void 0;\n this.#services.set(service.name, service);\n service.attach({\n discoverer: this.#discoverer,\n statusServer: this.#statusServer\n });\n for (const dependency of service.dependencies) {\n this.register(dependency);\n }\n return service;\n }\n async start() {\n await this.#ensureDiscovering();\n this.#assertAcyclic();\n const results = await Promise.allSettled([...this.#services.values()].map(service => this.#start(service)));\n const failed = results.find(result => result.status === \"rejected\");\n if (failed !== undefined) {\n await this.stop();\n throw failed.reason;\n }\n }\n async startService(service) {\n this.register(service);\n await this.#ensureDiscovering();\n this.#assertAcyclic();\n await this.#start(service);\n }\n async #ensureDiscovering() {\n if (!this.#started) {\n await this.#discoverer.start();\n this.#started = true;\n }\n }\n async #start(service) {\n const runningPromise = this.#starts.get(service.name);\n if (typeof runningPromise !== \"undefined\") {\n return runningPromise;\n }\n const started = this.#startImmediate(service);\n this.#starts.set(service.name, started);\n try {\n await started;\n } catch (err) {\n this.#starts.delete(service.name);\n throw err;\n }\n }\n async #startImmediate(service) {\n await Promise.all(this.#prerequisites(service).map(dependency => this.#start(dependency)));\n await service.start();\n await this.waitUntilReady(service);\n }\n\n /**\n * Everything that must be ready before `service` may start: its declared\n * dependencies, plus the status server.\n */\n #prerequisites(service) {\n return service.name === this.#statusServer.name ? service.dependencies : [this.#statusServer, ...service.dependencies];\n }\n\n /**\n * Poll a service's health until it is ready, reaches a terminal state, or\n * exceeds its timeout.\n */\n async waitUntilReady(service) {\n const deadline = Date.now() + DEFAULT_READY_TIMEOUT_MS;\n let health = await service.checkHealth();\n while (!health.ready) {\n const current = health;\n const notReady = () => `${service.name} is not ready (${current.state})${formatError(service, current)}`;\n !!current.terminal ? process.env.NODE_ENV !== \"production\" ? invariant(false, notReady) : invariant(false) : void 0;\n !(service.getExitInfo() === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, notReady) : invariant(false) : void 0;\n !(Date.now() < deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, () => `${service.name} is not ready (${current.state}) within ` + `${DEFAULT_READY_TIMEOUT_MS}ms${formatError(service, current)}`) : invariant(false) : void 0;\n await setTimeout(HEALTH_POLL_INTERVAL_MS);\n await this.#discoverer.refresh();\n health = await service.checkHealth();\n }\n return health;\n }\n async checkHealth() {\n await this.#discoverer.refresh();\n return Promise.all([...this.#services.values()].map(service => service.checkHealth()));\n }\n async checkDependencies(service) {\n await this.#discoverer.refresh();\n return Promise.all(service.dependencies.map(dependency => dependency.checkHealth()));\n }\n async dependenciesReady(service) {\n const healths = await this.checkDependencies(service);\n return healths.every(({\n ready\n }) => ready);\n }\n\n /**\n * Stop every service, dependents before their dependencies, waiting for each\n * process to be gone before the next is signalled.\n */\n async stop() {\n for (const service of this.#startupOrder().reverse()) {\n await service.stop();\n }\n this.#starts.clear();\n this.#discoverer.stop();\n this.#started = false;\n }\n\n /**\n * Registered services in a valid startup order: every service appears after\n * everything it depends on.\n */\n #startupOrder() {\n const ordered = [];\n const seen = new Set();\n const visit = service => {\n if (seen.has(service.name)) {\n return;\n }\n seen.add(service.name);\n for (const dependency of this.#prerequisites(service)) {\n visit(dependency);\n }\n ordered.push(service);\n };\n for (const service of this.#services.values()) {\n visit(service);\n }\n return ordered;\n }\n #assertAcyclic() {\n const settled = new Set();\n const visit = (service, walkedPath) => {\n if (settled.has(service.name)) {\n return;\n }\n const cycleStart = walkedPath.indexOf(service.name);\n !(cycleStart === -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, () => `Dependency cycle between services: ${[...walkedPath.slice(cycleStart), service.name].join(\" -> \")}`) : invariant(false) : void 0;\n for (const dependency of this.#prerequisites(service)) {\n visit(dependency, [...walkedPath, service.name]);\n }\n settled.add(service.name);\n };\n for (const service of this.#services.values()) {\n visit(service, []);\n }\n }\n}\nconst formatError = (service, health) => {\n const parts = [];\n if (health.message != null && health.message.length > 0) {\n parts.push(health.message);\n }\n const exit = service.getExitInfo();\n if (exit !== undefined) {\n parts.push(`the process exited (${exit})`);\n }\n const stderr = service.getCapturedStderr();\n if (stderr.length > 0) {\n parts.push(`stderr:\\n${stderr}`);\n }\n return parts.length === 0 ? \"\" : `: ${parts.join(\"; \")}`;\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path, { isAbsolute, resolve } from \"node:path\";\nimport { FoundryCliService } from \"./FoundryCliService.js\";\nexport class OntologyServer extends FoundryCliService {\n #metadataPath;\n constructor(config) {\n super(\"ONTOLOGY\", config);\n this.#metadataPath = isAbsolute(config.metadataPath) ? config.metadataPath : resolve(config.projectPath, config.metadataPath);\n }\n getMetadataPath() {\n return this.#metadataPath;\n }\n getArgs() {\n return [\"start\", \"ontology\", \"--skip-build\", \"--metadata\", this.#metadataPath, \"--discovery-path\", path.resolve(this.getProjectPath(), \".palantir\")];\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SeedBuilder } from \"@osdk/seed-helpers\";\nimport { OntologySeedingService } from \"./generated/cli/index.js\";\nexport function createSeedClient(config) {\n const {\n baseUrl,\n metadata,\n fetchFn\n } = config;\n const builder = new SeedBuilder(metadata);\n const seedClientFunction = async seed => {\n let result;\n if (typeof seed === \"function\") {\n result = seed(builder);\n } else {\n builder.addAll(seed);\n }\n await applySeed(builder.build());\n return result;\n };\n const applySeed = async seed => {\n const res = await OntologySeedingService.setSeed({\n baseUrl,\n servicePath: \"/api\",\n fetchFn\n }, seed);\n return res;\n };\n const seedClientUtils = {\n ref: (o, pk) => builder.ref(o, pk),\n addAll: async output => {\n builder.addAll(output);\n await applySeed(builder.build());\n },\n set: async output => {\n builder.set(output);\n await applySeed(builder.build());\n },\n create: async (o, props) => {\n const ref = builder.create(o, props);\n await applySeed(builder.build());\n return ref;\n },\n update: async (ref, props) => {\n const returnedRef = builder.update(ref, props);\n await applySeed(builder.build());\n return returnedRef;\n },\n delete: async ref => {\n builder.delete(ref);\n await applySeed(builder.build());\n },\n link: async (source, apiName, target) => {\n builder.link(source, apiName, target);\n await applySeed(builder.build());\n },\n unlink: async (source, apiName, target) => {\n builder.unlink(source, apiName, target);\n await applySeed(builder.build());\n }\n };\n return Object.defineProperties(seedClientFunction, Object.getOwnPropertyDescriptors(seedClientUtils));\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {}\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {}\n },\n ruleSets: {}\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\nimport invariant from \"tiny-invariant\";\nimport { Agent, fetch as undiciFetch } from \"undici\";\nimport { CliServiceLauncher } from \"./cli-service/CliServiceLauncher.js\";\nimport { OntologyServer } from \"./cli-service/OntologyServer.js\";\nimport { createIntegrationClient } from \"./createIntegrationClient.js\";\nimport { createSeedClient } from \"./createSeedClient.js\";\nimport { EMPTY_ONTOLOGY_BLOCK_DATA } from \"./utils/empty-ontology-block.js\";\nconst transformMetadata = metadata => {\n const transformed = PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData(EMPTY_ONTOLOGY_BLOCK_DATA, metadata);\n return {\n ...transformed,\n ontology: metadata.ontology\n };\n};\nconst writeMetadata = async args => {\n const {\n metadataPath,\n previewMetadata\n } = args;\n const stringified = JSON.stringify(previewMetadata);\n await fs.writeFile(metadataPath, stringified);\n};\nexport async function createIntegrationServer(config) {\n const {\n metadata,\n projectPath = process.cwd(),\n foundryCliPath\n } = config;\n const testPath = await fs.mkdtemp(path.join(projectPath, \".test-run-\"));\n const metadataPath = path.resolve(testPath, \"ontology-metadata.json\");\n const previewMetadata = transformMetadata(metadata);\n const serviceLauncher = new CliServiceLauncher({\n projectDir: testPath,\n foundryCliPath\n });\n // write metadata to metadataPath for foundry cli to read from\n await writeMetadata({\n previewMetadata,\n metadataPath\n });\n const ontology = serviceLauncher.register(new OntologyServer({\n projectPath: testPath,\n metadataPath,\n foundryCliPath\n }));\n\n // stateful cache of client and seed client\n let client;\n let seedClient;\n return {\n getOntologyUrl: () => ontology.getUrl(),\n start: async () => {\n await serviceLauncher.start();\n },\n stop: async () => {\n await serviceLauncher.stop();\n await fs.rm(testPath, {\n recursive: true,\n force: true\n });\n },\n getSeedClient: async () => {\n if (seedClient !== undefined) return seedClient;\n const baseUrl = ontology.getUrl();\n !baseUrl ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Ontology server is not ready\") : invariant(false) : void 0;\n const caCertPath = ontology.getCaCertPath();\n !caCertPath ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Ontology server is not ready\") : invariant(false) : void 0;\n const agent = new Agent({\n connect: caCertPath ? {\n ca: await fs.readFile(caCertPath)\n } : {\n rejectUnauthorized: false\n }\n });\n const fetchWithCert = (input, init) => undiciFetch(input, {\n ...init,\n dispatcher: agent\n });\n return seedClient = createSeedClient({\n baseUrl,\n metadata,\n fetchFn: fetchWithCert\n });\n },\n getClient: async () => {\n if (client !== undefined) return client;\n const baseUrl = ontology.getUrl();\n !baseUrl ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Ontology server is not ready\") : invariant(false) : void 0;\n return client = await createIntegrationClient({\n baseUrl,\n metadata,\n caCertPath: ontology.getCaCertPath()\n });\n }\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { gte, valid } from \"semver\";\nexport const MIN_FOUNDRY_CLI_VERSION = \"0.224.0\";\nconst FOUNDRY_VERSION_PATTERN = /cli (\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)/u;\nconst parseFoundryVersion = stdout => stdout.trim().match(FOUNDRY_VERSION_PATTERN)?.[1];\nconst versionIsAtMinimum = (version, min) => valid(version) != null && valid(min) != null && gte(version, min);\nconst execAsync = promisify(exec);\nexport const checkFoundryCliVersion = () => {\n return execAsync(\"which foundry\").then(() => execAsync(\"foundry --version\")).then(({\n stdout\n }) => {\n const version = parseFoundryVersion(stdout);\n if (!version) return {\n type: \"version-error\"\n };\n const isMin = versionIsAtMinimum(version, MIN_FOUNDRY_CLI_VERSION);\n if (!isMin) return {\n type: \"version-incompatible\",\n version\n };\n return {\n type: \"installed\",\n version\n };\n }).catch(() => ({\n type: \"not-found\"\n }));\n};"]}
|
|
1
|
+
{"version":3,"sources":["../../src/createIntegrationClient.ts","../../src/cli-service/FoundryCliService.ts","../../src/utils/process.ts","../../src/utils/service.ts","../../src/cli-service/ServiceDiscoverer.ts","../../src/generated/cli/OntologySeedingService.ts","../../src/generated/cli/OntologySeedingService/setSeed.ts","../../src/generated/cli/StatusService.ts","../../src/generated/cli/StatusService/publishStatus.ts","../../src/generated/cli/StatusService/getStatus.ts","../../src/cli-service/StatusServer.ts","../../src/cli-service/CliServiceLauncher.ts","../../src/cli-service/OntologyServer.ts","../../src/createSeedClient.ts","../../src/utils/empty-ontology-block.ts","../../src/createIntegrationServer.ts","../../src/utils/foundry-cli.ts"],"names":["Agent","fs","undiciFetch","createClient","createMockClient","client","invariant","spawn","resolve","once","fs2","join","conjureFetch","path","setTimeout","isAbsolute","SeedBuilder","PreviewOntologyIrConverter","valid","gte","promisify","exec"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,eAAsB,wBAAwB,MAAA,EAAQ;AACpD,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACF,GAAI,MAAA;AACJ,EAAA,MAAM,KAAA,GAAQ,IAAIA,YAAA,CAAM;AAAA,IACtB,SAAS,UAAA,GAAa;AAAA,MACpB,EAAA,EAAI,MAAMC,sBAAA,CAAG,QAAA,CAAS,UAAU;AAAA,KAClC,GAAI;AAAA,MACF,kBAAA,EAAoB;AAAA;A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,CAAA,IAAK,IAAA,IAAQC,UAAA,CAAI,SAAS,GAAG,CAAA;AAC7G,IAAM,SAAA,GAAYC,eAAUC,kBAAI,CAAA;AACzB,IAAM,yBAAyB,MAAM;AAC1C,EAAA,OAAO,SAAA,CAAU,eAAe,CAAA,CAAE,IAAA,CAAK,MAAM,UAAU,mBAAmB,CAAC,CAAA,CAAE,IAAA,CAAK,CAAC;AAAA,IACjF;AAAA,GACF,KAAM;AACJ,IAAA,MAAM,OAAA,GAAU,oBAAoB,MAAM,CAAA;AAC1C,IAAA,IAAI,CAAC,SAAS,OAAO;AAAA,MACnB,IAAA,EAAM;AAAA,KACR;AACA,IAAA,MAAM,KAAA,GAAQ,kBAAA,CAAmB,OAAA,EAAS,uBAAuB,CAAA;AACjE,IAAA,IAAI,CAAC,OAAO,OAAO;AAAA,MACjB,IAAA,EAAM,sBAAA;AAAA,MACN;AAAA,KACF;AACA,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,WAAA;AAAA,MACN;AAAA,KACF;AAAA,EACF,CAAC,CAAA,CAAE,KAAA,CAAM,OAAO;AAAA,IACd,IAAA,EAAM;AAAA,GACR,CAAE,CAAA;AACJ","file":"index.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs/promises\";\nimport { createClient } from \"@osdk/client\";\nimport { createMockClient } from \"@osdk/unit-testing\";\nimport { fetch as undiciFetch, Agent } from \"undici\";\n\n/** The definition kinds accepted by {@link Client}'s call signatures. */\n\nexport async function createIntegrationClient(config) {\n const {\n baseUrl,\n metadata,\n caCertPath\n } = config;\n const agent = new Agent({\n connect: caCertPath ? {\n ca: await fs.readFile(caCertPath)\n } : {\n rejectUnauthorized: false\n }\n });\n const fetchWithCert = (input, init) => undiciFetch(input, {\n ...init,\n dispatcher: agent\n });\n const realClient = createClient(baseUrl, metadata.ontology.rid, () => Promise.resolve(\"integration-client-token\"), {}, fetchWithCert);\n const mockClient = createMockClient();\n const clientInternal = def => {\n switch (def.type) {\n case \"query\":\n return mockClient(def);\n case \"action\":\n return realClient(def);\n case \"interface\":\n return realClient(def);\n case \"object\":\n return realClient(def);\n case \"experiment\":\n default:\n return realClient(def);\n }\n };\n const client = Object.defineProperties(clientInternal, {\n ...Object.getOwnPropertyDescriptors(realClient),\n whenQuery: {\n value: mockClient.whenQuery.bind(undefined)\n },\n clearStubs: {\n value: mockClient.clearStubs.bind(undefined)\n }\n });\n return client;\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { spawn } from \"node:child_process\";\nimport { once } from \"node:events\";\nimport invariant from \"tiny-invariant\";\nconst MAX_CAPTURED_STDERR_CHUNKS = 32;\nexport const DEFAULT_READY_TIMEOUT_MS = 30_000;\nexport const DEFAULT_STOP_GRACE_MS = 5_000;\n\n/**\n * The shared collaborators a service needs to answer questions about itself.\n * Injected by the launcher via {@link FoundryCliService.attach} so services do\n * not have to construct — or know how to reach — either one.\n */\n\nconst TERMINAL_STATES = new Set([\"FAILED\", \"STOPPED\"]);\n\n/**\n * One Foundry CLI service subprocess.\n *\n * Subclasses supply the `foundry` subcommand to run and, where the default is\n * wrong, how to tell that the service is up.\n *\n * Dependencies are declared but not enforced here: a service names what it needs\n * and {@link CliServiceLauncher} is what orders and awaits them.\n */\nexport class FoundryCliService {\n #foundryCliPath;\n #projectPath;\n #child;\n #context;\n #stderr = [];\n #exit;\n constructor(name, config) {\n this.name = name;\n this.dependencies = config.dependencies ?? [];\n this.#foundryCliPath = config.foundryCliPath ?? \"foundry\";\n this.#projectPath = config.projectPath;\n }\n getProjectPath() {\n return this.#projectPath;\n }\n getCaCertPath() {\n return this.#context?.discoverer.get(this.name)?.caCertPath ?? undefined;\n }\n getUrl() {\n return this.#context?.discoverer.get(this.name)?.url;\n }\n getExitInfo() {\n if (this.#exit === undefined) {\n return undefined;\n }\n const {\n code,\n signal\n } = this.#exit;\n return signal ?? `code ${code}`;\n }\n getCapturedStderr() {\n return this.#stderr.join(\"\").trim();\n }\n getContext() {\n const context = this.#context;\n !(context !== undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${this.name} is not registered with a CliServiceLauncher, so it has ` + `no discoverer or status server to consult`) : invariant(false) : void 0;\n return context;\n }\n attach(context) {\n this.#context = context;\n }\n async start() {\n if (this.#child !== undefined) {\n return;\n }\n await this.getContext().discoverer.refresh();\n !!(await this.checkHealth()).ready ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${this.name} is already running; stop it before starting a new one`) : invariant(false) : void 0;\n await this.#spawn();\n }\n async #spawn() {\n this.#exit = undefined;\n this.#stderr = [];\n const child = spawn(this.#foundryCliPath, [...this.getArgs()], {\n cwd: this.#projectPath\n });\n this.#child = child;\n child.stderr.setEncoding(\"utf-8\");\n child.stderr.on(\"data\", chunk => {\n if (this.#stderr.push(chunk) > MAX_CAPTURED_STDERR_CHUNKS) {\n this.#stderr.shift();\n }\n });\n child.stdout.resume(); // flush, since we don't read from stdout\n child.on(\"exit\", (code, signal) => {\n this.#exit = {\n code,\n signal\n };\n });\n await new Promise((resolve, reject) => {\n child.once(\"spawn\", resolve);\n child.once(\"error\", error => reject(new Error(`Failed to spawn ${this.name} via ${this.#foundryCliPath}`, {\n cause: error\n })));\n });\n }\n async checkHealth() {\n const {\n discoverer,\n statusServer\n } = this.getContext();\n const discovery = discoverer.get(this.name);\n if (typeof discovery === \"undefined\") {\n return {\n service: this.name,\n state: \"UNDISCOVERED\",\n ready: false,\n terminal: false\n };\n }\n const status = await statusServer.getServiceStatus(this.name);\n const state = status?.status ?? \"DISCOVERED\";\n return {\n service: this.name,\n state,\n ready: state === \"READY\",\n terminal: TERMINAL_STATES.has(state),\n url: discovery.url,\n ...(status?.message != null ? {\n message: status.message\n } : {})\n };\n }\n\n /**\n * Signal the service and wait for the process to actually be gone.\n */\n async stop() {\n const child = this.#child;\n this.#child = undefined;\n if (child === undefined || child.exitCode != null || child.signalCode != null) {\n return;\n }\n const exited = once(child, \"exit\");\n child.kill(\"SIGINT\");\n const escalation = setTimeout(() => {\n child.kill(\"SIGKILL\");\n }, DEFAULT_STOP_GRACE_MS);\n try {\n await exited;\n } finally {\n clearTimeout(escalation);\n }\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const isProcessAlive = pid => {\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n // EPERM means the process exists but is owned by another user.\n return err.code === \"EPERM\";\n }\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst SERVICE_FILE_NAMES = {\n ONTOLOGY: \"ontology\",\n TYPESCRIPT_FUNCTIONS: \"typescript-functions\",\n PYTHON_FUNCTIONS: \"python-functions\",\n APP: \"app\",\n STATUS_SERVER: \"status-server\",\n PLATFORM_API_PROXY: \"platform-api-proxy\"\n};\nconst SERVICE_NAMES_BY_FILE_NAME = new Map(Object.entries(SERVICE_FILE_NAMES).map(([name, stem]) => [stem, name]));\nexport const serviceNameFromFileName = fileName => {\n const name = fileName.match(/^\\.?(?<name>.+)-discovery\\.json$/u)?.groups?.name;\n return name === undefined ? undefined : SERVICE_NAMES_BY_FILE_NAME.get(name);\n};\n\n/** The name a running service publishes its discovery record under. */\nexport const discoveryFileName = name => `.${SERVICE_FILE_NAMES[name]}-discovery.json`;","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as fs from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport { isProcessAlive } from \"../utils/process.js\";\nimport { serviceNameFromFileName } from \"../utils/service.js\";\n/**\n * Reads the discovery files that running Foundry services publish into\n * `basePath`.\n */\nexport class ServiceDiscoverer {\n #basePath;\n #discovered = new Map();\n constructor(args) {\n this.#basePath = args.basePath;\n }\n get discoveryDir() {\n return this.#basePath;\n }\n async start() {\n await fs.mkdir(this.#basePath, {\n recursive: true\n });\n await this.refresh();\n }\n\n /**\n * Re-read every discovery file in the directory.\n */\n async refresh() {\n const fileNames = await fs.readdir(this.#basePath);\n const discoveries = await Promise.all(fileNames.map(fileName => this.#read(fileName)));\n return discoveries.filter(discovery => discovery !== undefined);\n }\n get(name) {\n const discovery = this.#discovered.get(name);\n if (typeof discovery === \"undefined\") {\n return undefined;\n }\n if (!isProcessAlive(discovery.pid)) {\n this.#discovered.delete(name); // Stale: the publisher died without cleaning up after itself.\n return undefined;\n }\n return discovery;\n }\n isDiscovered(name) {\n return this.get(name) !== undefined;\n }\n all() {\n const live = new Map();\n for (const name of this.#discovered.keys()) {\n const discovery = this.get(name);\n if (discovery !== undefined) {\n live.set(name, discovery);\n }\n }\n return live;\n }\n stop() {\n this.#discovered.clear();\n }\n async #read(fileName) {\n const serviceName = serviceNameFromFileName(fileName);\n if (typeof serviceName === \"undefined\") {\n return undefined;\n }\n let contents;\n try {\n contents = await fs.readFile(join(this.#basePath, fileName), \"utf-8\");\n } catch {\n this.#discovered.delete(serviceName);\n return undefined;\n }\n let parsed;\n try {\n parsed = JSON.parse(contents);\n } catch {\n return undefined;\n }\n !parsed.url ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Service URL not found`) : invariant(false) : void 0;\n this.#discovered.set(serviceName, parsed);\n return parsed;\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nexport { setSeed } from \"./OntologySeedingService/setSeed.js\";","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nimport { conjureFetch } from \"conjure-lite\";\n/**\n * Sets the seed state of the local ontology server. Succeeds with an\n * empty `200` response; failures surface as errors: 400 for a malformed\n * request body, 503 while the server is still starting, and 500 (with\n * the underlying detail) for seeding failures.\n */\nexport async function setSeed(ctx, seed) {\n return conjureFetch(ctx, `/seed`, \"PUT\", seed);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nexport { publishStatus } from \"./StatusService/publishStatus.js\";\nexport { getStatus } from \"./StatusService/getStatus.js\";","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nimport { conjureFetch } from \"conjure-lite\";\n/**\n * Publish a lifecycle event. Called by services whenever a status\n * transition occurs.\n */\nexport async function publishStatus(ctx, status) {\n return conjureFetch(ctx, `/status`, \"POST\", status);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**/\nimport { conjureFetch } from \"conjure-lite\";\n/**\n * Return the current status of all services.\n */\nexport async function getStatus(ctx) {\n return conjureFetch(ctx, `/status`, \"GET\");\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport { StatusService } from \"../generated/cli/index.js\";\nimport { FoundryCliService } from \"./FoundryCliService.js\";\nconst HEALTH_REQUEST_TIMEOUT_MS = 2_000;\n/**\n * The local status server, and the health authority for every other service.\n */\nexport class StatusServer extends FoundryCliService {\n /** Shared by callers that ask while a fetch is already outstanding. */\n #inFlight;\n constructor(config) {\n super(\"STATUS_SERVER\", config);\n }\n getArgs() {\n // force project path to cwd\n return [\"start\", \"status-server\", \"--discovery-path\", path.resolve(this.getProjectPath(), \".palantir\")];\n }\n async checkHealth() {\n const discovery = this.getContext().discoverer.get(\"STATUS_SERVER\");\n if (discovery === undefined) {\n return {\n service: \"STATUS_SERVER\",\n state: \"UNDISCOVERED\",\n ready: false,\n terminal: false\n };\n }\n const healthy = await this.#isHealthy(discovery.url);\n return {\n service: \"STATUS_SERVER\",\n state: healthy ? \"READY\" : \"DISCOVERED\",\n ready: healthy,\n terminal: false,\n url: discovery.url\n };\n }\n async #isHealthy(baseUrl) {\n try {\n const response = await fetch(new URL(\"/api/health\", baseUrl), {\n signal: AbortSignal.timeout(HEALTH_REQUEST_TIMEOUT_MS)\n });\n if (!response.ok) {\n return false;\n }\n const body = await response.json();\n return body.status === \"healthy\";\n } catch {\n return false;\n }\n }\n\n /**\n * The lifecycle snapshot for every service.\n */\n async getServiceStatuses() {\n const baseUrl = this.getContext().discoverer.get(\"STATUS_SERVER\")?.url;\n !baseUrl ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Cannot get service status because the status server is not discovered yet\") : invariant(false) : void 0;\n this.#inFlight ??= StatusService.getStatus({\n baseUrl,\n servicePath: \"\"\n }).catch(() => undefined).finally(() => {\n this.#inFlight = undefined;\n });\n const result = await this.#inFlight;\n return result ?? [];\n }\n async getServiceStatus(name) {\n const statuses = await this.getServiceStatuses();\n return statuses.find(({\n service\n }) => service === name);\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"node:path\";\nimport { setTimeout } from \"node:timers/promises\";\nimport invariant from \"tiny-invariant\";\nimport { DEFAULT_READY_TIMEOUT_MS } from \"./FoundryCliService.js\";\nimport { ServiceDiscoverer } from \"./ServiceDiscoverer.js\";\nimport { StatusServer } from \"./StatusServer.js\";\nconst HEALTH_POLL_INTERVAL_MS = 200;\n/**\n * Brings a set of Foundry services. Includes a status server by default.\n */\nexport class CliServiceLauncher {\n #discoverer;\n #statusServer;\n #services = new Map();\n\n /** Memoized in-flight starts, so a shared dependency is started once. */\n #starts = new Map();\n #started = false;\n constructor(config = {}) {\n const projectDir = config.projectDir ?? process.cwd();\n this.#discoverer = new ServiceDiscoverer({\n basePath: path.resolve(projectDir, \".palantir\")\n });\n this.#statusServer = config.statusServer ?? new StatusServer({\n projectPath: projectDir,\n foundryCliPath: config.foundryCliPath\n });\n this.register(this.#statusServer);\n }\n get services() {\n return [...this.#services.values()];\n }\n get(name) {\n return this.#services.get(name);\n }\n register(service) {\n const existing = this.#services.get(service.name);\n if (existing === service) {\n return service;\n }\n !(existing === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `A different ${service.name} service is already registered`) : invariant(false) : void 0;\n this.#services.set(service.name, service);\n service.attach({\n discoverer: this.#discoverer,\n statusServer: this.#statusServer\n });\n for (const dependency of service.dependencies) {\n this.register(dependency);\n }\n return service;\n }\n async start() {\n await this.#ensureDiscovering();\n this.#assertAcyclic();\n const results = await Promise.allSettled([...this.#services.values()].map(service => this.#start(service)));\n const failed = results.find(result => result.status === \"rejected\");\n if (failed !== undefined) {\n await this.stop();\n throw failed.reason;\n }\n }\n async startService(service) {\n this.register(service);\n await this.#ensureDiscovering();\n this.#assertAcyclic();\n await this.#start(service);\n }\n async #ensureDiscovering() {\n if (!this.#started) {\n await this.#discoverer.start();\n this.#started = true;\n }\n }\n async #start(service) {\n const runningPromise = this.#starts.get(service.name);\n if (typeof runningPromise !== \"undefined\") {\n return runningPromise;\n }\n const started = this.#startImmediate(service);\n this.#starts.set(service.name, started);\n try {\n await started;\n } catch (err) {\n this.#starts.delete(service.name);\n throw err;\n }\n }\n async #startImmediate(service) {\n await Promise.all(this.#prerequisites(service).map(dependency => this.#start(dependency)));\n await service.start();\n await this.waitUntilReady(service);\n }\n\n /**\n * Everything that must be ready before `service` may start: its declared\n * dependencies, plus the status server.\n */\n #prerequisites(service) {\n return service.name === this.#statusServer.name ? service.dependencies : [this.#statusServer, ...service.dependencies];\n }\n\n /**\n * Poll a service's health until it is ready, reaches a terminal state, or\n * exceeds its timeout.\n */\n async waitUntilReady(service) {\n const deadline = Date.now() + DEFAULT_READY_TIMEOUT_MS;\n let health = await service.checkHealth();\n while (!health.ready) {\n const current = health;\n const notReady = () => `${service.name} is not ready (${current.state})${formatError(service, current)}`;\n !!current.terminal ? process.env.NODE_ENV !== \"production\" ? invariant(false, notReady) : invariant(false) : void 0;\n !(service.getExitInfo() === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, notReady) : invariant(false) : void 0;\n !(Date.now() < deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, () => `${service.name} is not ready (${current.state}) within ` + `${DEFAULT_READY_TIMEOUT_MS}ms${formatError(service, current)}`) : invariant(false) : void 0;\n await setTimeout(HEALTH_POLL_INTERVAL_MS);\n await this.#discoverer.refresh();\n health = await service.checkHealth();\n }\n return health;\n }\n async checkHealth() {\n await this.#discoverer.refresh();\n return Promise.all([...this.#services.values()].map(service => service.checkHealth()));\n }\n async checkDependencies(service) {\n await this.#discoverer.refresh();\n return Promise.all(service.dependencies.map(dependency => dependency.checkHealth()));\n }\n async dependenciesReady(service) {\n const healths = await this.checkDependencies(service);\n return healths.every(({\n ready\n }) => ready);\n }\n\n /**\n * Stop every service, dependents before their dependencies, waiting for each\n * process to be gone before the next is signalled.\n */\n async stop() {\n for (const service of this.#startupOrder().reverse()) {\n await service.stop();\n }\n this.#starts.clear();\n this.#discoverer.stop();\n this.#started = false;\n }\n\n /**\n * Registered services in a valid startup order: every service appears after\n * everything it depends on.\n */\n #startupOrder() {\n const ordered = [];\n const seen = new Set();\n const visit = service => {\n if (seen.has(service.name)) {\n return;\n }\n seen.add(service.name);\n for (const dependency of this.#prerequisites(service)) {\n visit(dependency);\n }\n ordered.push(service);\n };\n for (const service of this.#services.values()) {\n visit(service);\n }\n return ordered;\n }\n #assertAcyclic() {\n const settled = new Set();\n const visit = (service, walkedPath) => {\n if (settled.has(service.name)) {\n return;\n }\n const cycleStart = walkedPath.indexOf(service.name);\n !(cycleStart === -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, () => `Dependency cycle between services: ${[...walkedPath.slice(cycleStart), service.name].join(\" -> \")}`) : invariant(false) : void 0;\n for (const dependency of this.#prerequisites(service)) {\n visit(dependency, [...walkedPath, service.name]);\n }\n settled.add(service.name);\n };\n for (const service of this.#services.values()) {\n visit(service, []);\n }\n }\n}\nconst formatError = (service, health) => {\n const parts = [];\n if (health.message != null && health.message.length > 0) {\n parts.push(health.message);\n }\n const exit = service.getExitInfo();\n if (exit !== undefined) {\n parts.push(`the process exited (${exit})`);\n }\n const stderr = service.getCapturedStderr();\n if (stderr.length > 0) {\n parts.push(`stderr:\\n${stderr}`);\n }\n return parts.length === 0 ? \"\" : `: ${parts.join(\"; \")}`;\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path, { isAbsolute, resolve } from \"node:path\";\nimport { FoundryCliService } from \"./FoundryCliService.js\";\nexport class OntologyServer extends FoundryCliService {\n #metadataPath;\n constructor(config) {\n super(\"ONTOLOGY\", config);\n this.#metadataPath = isAbsolute(config.metadataPath) ? config.metadataPath : resolve(config.projectPath, config.metadataPath);\n }\n getMetadataPath() {\n return this.#metadataPath;\n }\n getArgs() {\n return [\"start\", \"ontology\", \"--skip-build\", \"--metadata\", this.#metadataPath, \"--discovery-path\", path.resolve(this.getProjectPath(), \".palantir\")];\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SeedBuilder } from \"@osdk/seed-helpers\";\nimport { OntologySeedingService } from \"./generated/cli/index.js\";\nexport function createSeedClient(config) {\n const {\n baseUrl,\n metadata,\n fetchFn\n } = config;\n const builder = new SeedBuilder(metadata);\n const seedClientFunction = async seed => {\n let result;\n if (typeof seed === \"function\") {\n result = seed(builder);\n } else {\n builder.addAll(seed);\n }\n await applySeed(builder.build());\n return result;\n };\n const applySeed = async seed => {\n const res = await OntologySeedingService.setSeed({\n baseUrl,\n servicePath: \"/api\",\n fetchFn\n }, seed);\n return res;\n };\n const seedClientUtils = {\n ref: (o, pk) => builder.ref(o, pk),\n addAll: async output => {\n builder.addAll(output);\n await applySeed(builder.build());\n },\n set: async output => {\n builder.set(output);\n await applySeed(builder.build());\n },\n create: async (o, props) => {\n const ref = builder.create(o, props);\n await applySeed(builder.build());\n return ref;\n },\n update: async (ref, props) => {\n const returnedRef = builder.update(ref, props);\n await applySeed(builder.build());\n return returnedRef;\n },\n delete: async ref => {\n builder.delete(ref);\n await applySeed(builder.build());\n },\n link: async (source, apiName, target) => {\n builder.link(source, apiName, target);\n await applySeed(builder.build());\n },\n unlink: async (source, apiName, target) => {\n builder.unlink(source, apiName, target);\n await applySeed(builder.build());\n }\n };\n return Object.defineProperties(seedClientFunction, Object.getOwnPropertyDescriptors(seedClientUtils));\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {}\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectPropertyTypeIdsToRids: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n structFieldRidsToApiNames: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {}\n },\n ruleSets: {}\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\nimport invariant from \"tiny-invariant\";\nimport { Agent, fetch as undiciFetch } from \"undici\";\nimport { CliServiceLauncher } from \"./cli-service/CliServiceLauncher.js\";\nimport { OntologyServer } from \"./cli-service/OntologyServer.js\";\nimport { createIntegrationClient } from \"./createIntegrationClient.js\";\nimport { createSeedClient } from \"./createSeedClient.js\";\nimport { EMPTY_ONTOLOGY_BLOCK_DATA } from \"./utils/empty-ontology-block.js\";\nconst transformMetadata = metadata => {\n const transformed = PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData(EMPTY_ONTOLOGY_BLOCK_DATA, metadata);\n return {\n ...transformed,\n ontology: metadata.ontology\n };\n};\nconst writeMetadata = async args => {\n const {\n metadataPath,\n previewMetadata\n } = args;\n const stringified = JSON.stringify(previewMetadata);\n await fs.writeFile(metadataPath, stringified);\n};\nexport async function createIntegrationServer(config) {\n const {\n metadata,\n projectPath = process.cwd(),\n foundryCliPath\n } = config;\n const testPath = await fs.mkdtemp(path.join(projectPath, \".test-run-\"));\n const metadataPath = path.resolve(testPath, \"ontology-metadata.json\");\n const previewMetadata = transformMetadata(metadata);\n const serviceLauncher = new CliServiceLauncher({\n projectDir: testPath,\n foundryCliPath\n });\n // write metadata to metadataPath for foundry cli to read from\n await writeMetadata({\n previewMetadata,\n metadataPath\n });\n const ontology = serviceLauncher.register(new OntologyServer({\n projectPath: testPath,\n metadataPath,\n foundryCliPath\n }));\n\n // stateful cache of client and seed client\n let client;\n let seedClient;\n return {\n getOntologyUrl: () => ontology.getUrl(),\n start: async () => {\n await serviceLauncher.start();\n },\n stop: async () => {\n await serviceLauncher.stop();\n await fs.rm(testPath, {\n recursive: true,\n force: true\n });\n },\n getSeedClient: async () => {\n if (seedClient !== undefined) return seedClient;\n const baseUrl = ontology.getUrl();\n !baseUrl ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Ontology server is not ready\") : invariant(false) : void 0;\n const caCertPath = ontology.getCaCertPath();\n !caCertPath ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Ontology server is not ready\") : invariant(false) : void 0;\n const agent = new Agent({\n connect: caCertPath ? {\n ca: await fs.readFile(caCertPath)\n } : {\n rejectUnauthorized: false\n }\n });\n const fetchWithCert = (input, init) => undiciFetch(input, {\n ...init,\n dispatcher: agent\n });\n return seedClient = createSeedClient({\n baseUrl,\n metadata,\n fetchFn: fetchWithCert\n });\n },\n getClient: async () => {\n if (client !== undefined) return client;\n const baseUrl = ontology.getUrl();\n !baseUrl ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Ontology server is not ready\") : invariant(false) : void 0;\n return client = await createIntegrationClient({\n baseUrl,\n metadata,\n caCertPath: ontology.getCaCertPath()\n });\n }\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { gte, valid } from \"semver\";\nexport const MIN_FOUNDRY_CLI_VERSION = \"0.224.0\";\nconst FOUNDRY_VERSION_PATTERN = /cli (\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)/u;\nconst parseFoundryVersion = stdout => stdout.trim().match(FOUNDRY_VERSION_PATTERN)?.[1];\nconst versionIsAtMinimum = (version, min) => valid(version) != null && valid(min) != null && gte(version, min);\nconst execAsync = promisify(exec);\nexport const checkFoundryCliVersion = () => {\n return execAsync(\"which foundry\").then(() => execAsync(\"foundry --version\")).then(({\n stdout\n }) => {\n const version = parseFoundryVersion(stdout);\n if (!version) return {\n type: \"version-error\"\n };\n const isMin = versionIsAtMinimum(version, MIN_FOUNDRY_CLI_VERSION);\n if (!isMin) return {\n type: \"version-incompatible\",\n version\n };\n return {\n type: \"installed\",\n version\n };\n }).catch(() => ({\n type: \"not-found\"\n }));\n};"]}
|
|
@@ -18,7 +18,13 @@ import consola from "consola";
|
|
|
18
18
|
import invariant from "tiny-invariant";
|
|
19
19
|
import { checkFoundryCliVersion, MIN_FOUNDRY_CLI_VERSION } from "../utils/foundry-cli.js";
|
|
20
20
|
import { installFoundryCli } from "./download.js";
|
|
21
|
+
import { readGitRemoteUrl } from "./gitRemote.js";
|
|
21
22
|
export const postinstall = async () => {
|
|
23
|
+
const remote = await readGitRemoteUrl();
|
|
24
|
+
if (remote === "git@github.com:palantir/osdk-ts.git" || remote === "https://github.com/palantir/osdk-ts.git") {
|
|
25
|
+
consola.info(`✅ In osdk-ts repo, skipping installation.`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
22
28
|
const result = await checkFoundryCliVersion();
|
|
23
29
|
switch (result.type) {
|
|
24
30
|
case "installed":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","names":["consola","invariant","checkFoundryCliVersion","MIN_FOUNDRY_CLI_VERSION","installFoundryCli","
|
|
1
|
+
{"version":3,"file":"postinstall.js","names":["consola","invariant","checkFoundryCliVersion","MIN_FOUNDRY_CLI_VERSION","installFoundryCli","readGitRemoteUrl","postinstall","remote","info","result","type","version","warn","process","env","NODE_ENV"],"sources":["postinstall.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport consola from \"consola\";\nimport invariant from \"tiny-invariant\";\n\nimport {\n checkFoundryCliVersion,\n MIN_FOUNDRY_CLI_VERSION,\n} from \"../utils/foundry-cli.js\";\nimport { installFoundryCli } from \"./download.js\";\nimport { readGitRemoteUrl } from \"./gitRemote.js\";\n\nexport const postinstall = async (): Promise<void> => {\n const remote = await readGitRemoteUrl();\n if (\n remote === \"git@github.com:palantir/osdk-ts.git\" ||\n remote === \"https://github.com/palantir/osdk-ts.git\"\n ) {\n consola.info(`✅ In osdk-ts repo, skipping installation.`);\n return;\n }\n const result = await checkFoundryCliVersion();\n switch (result.type) {\n case \"installed\":\n consola.info(\n `✅ Foundry CLI (v${result.version}) is installed already, skipping installation.`,\n );\n return;\n case \"version-error\":\n consola.warn(\n `Foundry CLI is installed, but we could not probe its version.`,\n );\n return;\n case \"version-incompatible\":\n invariant(\n false,\n `Foundry CLI (v${result.version}) is installed already, but the minimum required version is ${MIN_FOUNDRY_CLI_VERSION}. Please run \"foundry update self\" to update foundry cli.`,\n );\n return;\n case \"not-found\":\n consola.info(`Foundry CLI not found locally, attempting to install...`);\n await installFoundryCli();\n return;\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,OAAO,MAAM,SAAS;AAC7B,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SACEC,sBAAsB,EACtBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,gBAAgB,QAAQ,gBAAgB;AAEjD,OAAO,MAAMC,WAAW,GAAG,MAAAA,CAAA,KAA2B;EACpD,MAAMC,MAAM,GAAG,MAAMF,gBAAgB,CAAC,CAAC;EACvC,IACEE,MAAM,KAAK,qCAAqC,IAChDA,MAAM,KAAK,yCAAyC,EACpD;IACAP,OAAO,CAACQ,IAAI,CAAC,2CAA2C,CAAC;IACzD;EACF;EACA,MAAMC,MAAM,GAAG,MAAMP,sBAAsB,CAAC,CAAC;EAC7C,QAAQO,MAAM,CAACC,IAAI;IACjB,KAAK,WAAW;MACdV,OAAO,CAACQ,IAAI,CACV,mBAAmBC,MAAM,CAACE,OAAO,gDACnC,CAAC;MACD;IACF,KAAK,eAAe;MAClBX,OAAO,CAACY,IAAI,CACV,+DACF,CAAC;MACD;IACF,KAAK,sBAAsB;MACzBC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAd,SAAS,QAEP,iBAAiBQ,MAAM,CAACE,OAAO,+DAA+DR,uBAAuB,2DAA2D,IAFlLF,SAAS;MAIT;IACF,KAAK,WAAW;MACdD,OAAO,CAACQ,IAAI,CAAC,yDAAyD,CAAC;MACvE,MAAMJ,iBAAiB,CAAC,CAAC;EAE7B;AACF,CAAC","ignoreList":[]}
|
|
@@ -46,11 +46,13 @@ export const EMPTY_ONTOLOGY_BLOCK_DATA = {
|
|
|
46
46
|
linkTypeIds: {},
|
|
47
47
|
linkTypes: {},
|
|
48
48
|
markings: {},
|
|
49
|
+
objectPropertyTypeIdsToRids: {},
|
|
49
50
|
objectTypeIds: {},
|
|
50
51
|
objectTypes: {},
|
|
51
52
|
propertyTypeIds: {},
|
|
52
53
|
propertyTypes: {},
|
|
53
54
|
sharedPropertyTypes: {},
|
|
55
|
+
structFieldRidsToApiNames: {},
|
|
54
56
|
timeSeriesSyncs: {},
|
|
55
57
|
valueTypes: {},
|
|
56
58
|
webhooks: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-ontology-block.js","names":["EMPTY_ONTOLOGY_BLOCK_DATA","objectTypes","sharedPropertyTypes","interfaceTypes","linkTypes","actionTypes","blockPermissionInformation","blockOutputCompassLocations","knownIdentifiers","actionParameterIds","actionParameters","datasourceColumns","datasources","filesDatasources","functions","geotimeSeriesSyncs","groupIds","interfaceActionTypeConstraints","interfaceLinkTypes","interfaceParameterConstraints","interfacePropertyTypes","linkTypeIds","markings","objectTypeIds","propertyTypeIds","propertyTypes","timeSeriesSyncs","valueTypes","webhooks","workshopModules","ruleSets"],"sources":["empty-ontology-block.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\n\ntype OntologyBlockDataV2 = Parameters<\n typeof PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData\n>[0];\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA: OntologyBlockDataV2 = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {},\n },\n ruleSets: {},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,MAAMA,yBAA8C,GAAG;EAC5DC,WAAW,EAAE,CAAC,CAAC;EACfC,mBAAmB,EAAE,CAAC,CAAC;EACvBC,cAAc,EAAE,CAAC,CAAC;EAClBC,SAAS,EAAE,CAAC,CAAC;EACbC,WAAW,EAAE,CAAC,CAAC;EACfC,0BAA0B,EAAE;IAC1BD,WAAW,EAAE,CAAC,CAAC;IACfJ,WAAW,EAAE,CAAC,CAAC;IACfG,SAAS,EAAE,CAAC,CAAC;IACbD,cAAc,EAAE,CAAC,CAAC;IAClBD,mBAAmB,EAAE,CAAC;EACxB,CAAC;EACDK,2BAA2B,EAAE,CAAC,CAAC;EAC/BC,gBAAgB,EAAE;IAChBC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,gBAAgB,EAAE,CAAC,CAAC;IACpBL,WAAW,EAAE,CAAC,CAAC;IACfM,iBAAiB,EAAE,CAAC,CAAC;IACrBC,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,SAAS,EAAE,CAAC,CAAC;IACbC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,QAAQ,EAAE,CAAC,CAAC;IACZC,8BAA8B,EAAE,CAAC,CAAC;IAClCC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,6BAA6B,EAAE,CAAC,CAAC;IACjCC,sBAAsB,EAAE,CAAC,CAAC;IAC1BjB,cAAc,EAAE,CAAC,CAAC;IAClBkB,WAAW,EAAE,CAAC,CAAC;IACfjB,SAAS,EAAE,CAAC,CAAC;IACbkB,QAAQ,EAAE,CAAC,CAAC;IACZC,aAAa,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"empty-ontology-block.js","names":["EMPTY_ONTOLOGY_BLOCK_DATA","objectTypes","sharedPropertyTypes","interfaceTypes","linkTypes","actionTypes","blockPermissionInformation","blockOutputCompassLocations","knownIdentifiers","actionParameterIds","actionParameters","datasourceColumns","datasources","filesDatasources","functions","geotimeSeriesSyncs","groupIds","interfaceActionTypeConstraints","interfaceLinkTypes","interfaceParameterConstraints","interfacePropertyTypes","linkTypeIds","markings","objectPropertyTypeIdsToRids","objectTypeIds","propertyTypeIds","propertyTypes","structFieldRidsToApiNames","timeSeriesSyncs","valueTypes","webhooks","workshopModules","ruleSets"],"sources":["empty-ontology-block.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\n\ntype OntologyBlockDataV2 = Parameters<\n typeof PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData\n>[0];\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA: OntologyBlockDataV2 = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectPropertyTypeIdsToRids: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n structFieldRidsToApiNames: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {},\n },\n ruleSets: {},\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C;IACjBxB,mBAAmB,EAAE,CAAC,CAAC;IACvByB,yBAAyB,EAAE,CAAC,CAAC;IAC7BC,eAAe,EAAE,CAAC,CAAC;IACnBC,UAAU,EAAE,CAAC,CAAC;IACdC,QAAQ,EAAE,CAAC,CAAC;IACZC,eAAe,EAAE,CAAC;EACpB,CAAC;EACDC,QAAQ,EAAE,CAAC;AACb,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AA0BA,OAAO,cAAM,mBAAwB","names":[],"sources":["../../../src/scripts/postinstall.ts"],"version":3,"file":"postinstall.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/integration-testing",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73",
|
|
4
4
|
"description": "Integration-testing helpers for the Ontology SDK",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@osdk/foundry.ontologies": "2.
|
|
32
|
+
"@osdk/foundry.ontologies": "2.73.0",
|
|
33
33
|
"conjure-lite": "^0.7.3",
|
|
34
34
|
"consola": "^3.4.2",
|
|
35
35
|
"semver": "^7.7.2",
|
|
36
36
|
"tiny-invariant": "^1.3.3",
|
|
37
37
|
"undici": "^6.28.0",
|
|
38
|
-
"@osdk/generator-converters.preview": "~0.
|
|
39
|
-
"@osdk/unit-testing": "~0.21.
|
|
38
|
+
"@osdk/generator-converters.preview": "~0.35.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73",
|
|
39
|
+
"@osdk/unit-testing": "~0.21.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@osdk/seed-helpers": ">=0.25.0 <1.0.0",
|
|
43
|
-
"@osdk/api": "^2.
|
|
44
|
-
"@osdk/client": "^2.
|
|
43
|
+
"@osdk/api": "^2.57.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73",
|
|
44
|
+
"@osdk/client": "^2.57.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@microsoft/api-documenter": "^7.26.32",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"@types/semver": "^7.7.1",
|
|
51
51
|
"typescript": "~5.5.4",
|
|
52
52
|
"vitest": "^3.2.4",
|
|
53
|
-
"@osdk/api": "~2.
|
|
53
|
+
"@osdk/api": "~2.57.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73",
|
|
54
|
+
"@osdk/client": "~2.57.1-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73",
|
|
54
55
|
"@osdk/monorepo.api-extractor": "~0.7.0",
|
|
55
56
|
"@osdk/monorepo.tsconfig": "~0.7.0",
|
|
56
|
-
"@osdk/seed-helpers": "~0.
|
|
57
|
-
"@osdk/client": "~2.56.0"
|
|
57
|
+
"@osdk/seed-helpers": "~0.28.0-main-ab557b433f844940c359d54ba06ad3ba1f7e8e73"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|