casualos 4.2.3 → 4.2.4-alpha.25219073312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +88 -39
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -149486,7 +149486,7 @@ var trace = TraceAPI.getInstance();
149486
149486
  function hashLowEntropyPasswordWithSalt2(password, salt) {
149487
149487
  const tracer = trace.getTracer(
149488
149488
  "InstrumentedHashHelpers",
149489
- false ? void 0 : "v4.2.3"
149489
+ false ? void 0 : "v4.2.4-alpha.25219073312"
149490
149490
  );
149491
149491
  return tracer.startActiveSpan(
149492
149492
  "hashLowEntropyPasswordWithSalt",
@@ -149504,7 +149504,7 @@ function hashLowEntropyPasswordWithSalt2(password, salt) {
149504
149504
  function hashHighEntropyPasswordWithSalt2(password, salt) {
149505
149505
  const tracer = trace.getTracer(
149506
149506
  "InstrumentedHashHelpers",
149507
- false ? void 0 : "v4.2.3"
149507
+ false ? void 0 : "v4.2.4-alpha.25219073312"
149508
149508
  );
149509
149509
  return tracer.startActiveSpan(
149510
149510
  "hashHighEntropyPasswordWithSalt",
@@ -149522,7 +149522,7 @@ function hashHighEntropyPasswordWithSalt2(password, salt) {
149522
149522
  function verifyPasswordAgainstHashes2(password, salt, hashes) {
149523
149523
  const tracer = trace.getTracer(
149524
149524
  "InstrumentedHashHelpers",
149525
- false ? void 0 : "v4.2.3"
149525
+ false ? void 0 : "v4.2.4-alpha.25219073312"
149526
149526
  );
149527
149527
  return tracer.startActiveSpan(
149528
149528
  "verifyPasswordAgainstHashes",
@@ -157123,7 +157123,7 @@ function traced(tracerName, options = {}, metricOptions = {}) {
157123
157123
  }
157124
157124
  const tracer = trace.getTracer(
157125
157125
  tracerName,
157126
- false ? void 0 : "v4.2.3"
157126
+ false ? void 0 : "v4.2.4-alpha.25219073312"
157127
157127
  );
157128
157128
  return function(target, propertyKey, descriptor) {
157129
157129
  const originalMethod = descriptor.value;
@@ -157209,7 +157209,7 @@ function getHistogram(meter) {
157209
157209
  }
157210
157210
  return metrics.getMeter(
157211
157211
  meter.meter,
157212
- false ? void 0 : "v4.2.3"
157212
+ false ? void 0 : "v4.2.4-alpha.25219073312"
157213
157213
  ).createHistogram(meter.name, meter.options);
157214
157214
  }
157215
157215
  function getCounter(meter) {
@@ -157218,7 +157218,7 @@ function getCounter(meter) {
157218
157218
  }
157219
157219
  return metrics.getMeter(
157220
157220
  meter.meter,
157221
- false ? void 0 : "v4.2.3"
157221
+ false ? void 0 : "v4.2.4-alpha.25219073312"
157222
157222
  ).createCounter(meter.name, meter.options);
157223
157223
  }
157224
157224
  function traceHttpResponse(options = {}) {
@@ -171392,7 +171392,7 @@ var RecordsServer = class {
171392
171392
  this._viewTemplateRenderer = viewTemplateRenderer;
171393
171393
  this._tracer = trace.getTracer(
171394
171394
  "RecordsServer",
171395
- false ? void 0 : "v4.2.3"
171395
+ false ? void 0 : "v4.2.4-alpha.25219073312"
171396
171396
  );
171397
171397
  this._purchasableItems = purchasableItemsController;
171398
171398
  this._procedures = this._createProcedures();
@@ -171558,7 +171558,7 @@ var RecordsServer = class {
171558
171558
  }
171559
171559
  }
171560
171560
  const result = success2({
171561
- title: /* @__PURE__ */ React.createElement(React.Fragment, null, pageTitle),
171561
+ title: /* @__PURE__ */ React.createElement("title", null, pageTitle),
171562
171562
  description: /* @__PURE__ */ React.createElement(
171563
171563
  "meta",
171564
171564
  {
@@ -174063,6 +174063,7 @@ var RecordsServer = class {
174063
174063
  topP: external_exports.number().optional().nullable(),
174064
174064
  presencePenalty: external_exports.number().min(-2).max(2).optional().nullable(),
174065
174065
  frequencyPenalty: external_exports.number().min(-2).max(2).optional().nullable(),
174066
+ enableCaching: external_exports.boolean().optional().nullable(),
174066
174067
  stopWords: external_exports.array(external_exports.string()).max(4).optional().nullable()
174067
174068
  })
174068
174069
  ).handler(
@@ -174098,6 +174099,7 @@ var RecordsServer = class {
174098
174099
  topP: external_exports.number().optional().nullable(),
174099
174100
  presencePenalty: external_exports.number().min(-2).max(2).optional().nullable(),
174100
174101
  frequencyPenalty: external_exports.number().min(-2).max(2).optional().nullable(),
174102
+ enableCaching: external_exports.boolean().optional().nullable(),
174101
174103
  stopWords: external_exports.array(external_exports.string()).max(4).optional().nullable()
174102
174104
  })
174103
174105
  ).handler(
@@ -175448,8 +175450,8 @@ var RecordsServer = class {
175448
175450
  return {
175449
175451
  success: true,
175450
175452
  ...metadata,
175451
- version: true ? "v4.2.3" : void 0,
175452
- versionHash: true ? "12ca409bb4c3323ae13ec2f8de61e753565d569d" : void 0
175453
+ version: true ? "v4.2.4-alpha.25219073312" : void 0,
175454
+ versionHash: true ? "f825554246a92252d12ebec40803637e4ae62277" : void 0
175453
175455
  };
175454
175456
  }),
175455
175457
  getPurchasableItem: procedure().origins(true).http("GET", "/api/v2/records/purchasableItems").inputs(
@@ -191709,14 +191711,19 @@ var AnthropicAIChatInterface = class {
191709
191711
  }
191710
191712
  async chat(request2) {
191711
191713
  try {
191712
- let maxTokens = Math.min(request2.maxTokens, 4096);
191714
+ let maxTokens = Math.min(request2.maxTokens ?? 4096, 4096);
191713
191715
  const response = await this._ai.messages.create({
191714
191716
  max_tokens: maxTokens,
191715
191717
  top_p: request2.topP,
191716
191718
  temperature: request2.temperature,
191717
191719
  stop_sequences: request2.stopWords,
191718
191720
  model: request2.model,
191719
- messages: request2.messages.map((m4) => mapMessage2(m4))
191721
+ messages: request2.messages.map((m4) => mapMessage2(m4)),
191722
+ ...request2.enableCaching ? {
191723
+ cache_control: {
191724
+ type: "ephemeral"
191725
+ }
191726
+ } : {}
191720
191727
  });
191721
191728
  return {
191722
191729
  choices: [
@@ -191731,9 +191738,9 @@ var AnthropicAIChatInterface = class {
191731
191738
  };
191732
191739
  } catch (err) {
191733
191740
  const span = trace.getActiveSpan();
191734
- span?.recordException(err);
191735
191741
  span?.setStatus({ code: SpanStatusCode.ERROR });
191736
191742
  if (err instanceof Error) {
191743
+ span?.recordException(err);
191737
191744
  console.error(
191738
191745
  "[AnthropicAIChatInterface] Error occurred while generating content.",
191739
191746
  err
@@ -191753,14 +191760,19 @@ var AnthropicAIChatInterface = class {
191753
191760
  }
191754
191761
  async *chatStream(request2) {
191755
191762
  try {
191756
- let maxTokens = Math.min(request2.maxTokens, 4096);
191763
+ let maxTokens = Math.min(request2.maxTokens ?? 4096, 4096);
191757
191764
  const response = this._ai.messages.stream({
191758
191765
  max_tokens: maxTokens,
191759
191766
  top_p: request2.topP,
191760
191767
  temperature: request2.temperature,
191761
191768
  stop_sequences: request2.stopWords,
191762
191769
  model: request2.model,
191763
- messages: request2.messages.map((m4) => mapMessage2(m4))
191770
+ messages: request2.messages.map((m4) => mapMessage2(m4)),
191771
+ ...request2.enableCaching ? {
191772
+ cache_control: {
191773
+ type: "ephemeral"
191774
+ }
191775
+ } : {}
191764
191776
  });
191765
191777
  for await (const chunk of response) {
191766
191778
  if (chunk.type === "message_start") {
@@ -191790,9 +191802,9 @@ var AnthropicAIChatInterface = class {
191790
191802
  };
191791
191803
  } catch (err) {
191792
191804
  const span = trace.getActiveSpan();
191793
- span?.recordException(err);
191794
191805
  span?.setStatus({ code: SpanStatusCode.ERROR });
191795
191806
  if (err instanceof Error) {
191807
+ span?.recordException(err);
191796
191808
  console.error(
191797
191809
  "[AnthropicAIChatInterface] Error occurred while generating content.",
191798
191810
  err
@@ -220623,13 +220635,8 @@ function replaceMacros(text) {
220623
220635
  return text;
220624
220636
  }
220625
220637
  var Transpiler = class {
220626
- get forceSync() {
220627
- return this._forceSync;
220628
- }
220629
- set forceSync(value) {
220630
- this._forceSync = value;
220631
- }
220632
220638
  constructor(options) {
220639
+ this._jsxPreserveWhitespace = false;
220633
220640
  this._insertEnergyChecks = options?.insertEnergyChecks ?? true;
220634
220641
  this._cache = new import_lru_cache.default({
220635
220642
  max: 1e3
@@ -220656,6 +220663,12 @@ var Transpiler = class {
220656
220663
  this._exportFactory = options?.exportFactory ?? "exports";
220657
220664
  this._forceSync = options?.forceSync ?? false;
220658
220665
  }
220666
+ get forceSync() {
220667
+ return this._forceSync;
220668
+ }
220669
+ set forceSync(value) {
220670
+ this._forceSync = value;
220671
+ }
220659
220672
  parse(code) {
220660
220673
  const macroed = replaceMacros(code);
220661
220674
  const node = this._parse(macroed);
@@ -220724,6 +220737,7 @@ var Transpiler = class {
220724
220737
  if (cached2) {
220725
220738
  return cached2;
220726
220739
  }
220740
+ this._jsxPreserveWhitespace = directives.jsxPreserveWhitespace ?? false;
220727
220741
  const macroed = replaceMacros(code);
220728
220742
  const node = this._parse(macroed);
220729
220743
  const isAsync = directives.isAsync || this._isAsyncNode(node);
@@ -221940,27 +221954,57 @@ await ${this._exportFactory}({ `;
221940
221954
  _replaceJSXElementChildren(node, children, doc, text, metadata) {
221941
221955
  const version3 = { "0": getClock2(doc, 0) };
221942
221956
  for (let child of children) {
221943
- const pos = createRelativePositionFromStateVector2(
221944
- text,
221945
- version3,
221946
- child.end,
221947
- void 0,
221948
- true
221949
- );
221950
- this._replace(child, doc, text, metadata);
221951
- doc.clientID += 1;
221952
- const absoluteEnd = createAbsolutePositionFromRelativePosition(
221953
- pos,
221954
- doc
221955
- );
221956
- text.insert(absoluteEnd.index, ",");
221957
+ let changed = false;
221958
+ const changeHandler = () => {
221959
+ changed = true;
221960
+ };
221961
+ try {
221962
+ text.observe(changeHandler);
221963
+ const pos = createRelativePositionFromStateVector2(
221964
+ text,
221965
+ version3,
221966
+ child.end,
221967
+ void 0,
221968
+ true
221969
+ );
221970
+ this._replace(child, doc, text, metadata);
221971
+ if (!changed) {
221972
+ continue;
221973
+ }
221974
+ doc.clientID += 1;
221975
+ const absoluteEnd = createAbsolutePositionFromRelativePosition(
221976
+ pos,
221977
+ doc
221978
+ );
221979
+ text.insert(absoluteEnd.index, ",");
221980
+ } finally {
221981
+ text.unobserve(changeHandler);
221982
+ }
221957
221983
  }
221958
221984
  }
221959
221985
  _replaceJSXText(node, doc, text) {
221960
221986
  doc.clientID += 1;
221961
221987
  const version3 = { "0": getClock2(doc, 0) };
221962
- const startIndex = node.start;
221963
- const endIndex = node.end;
221988
+ let startIndex;
221989
+ let endIndex;
221990
+ if (!this._jsxPreserveWhitespace) {
221991
+ const isMultiLine = /\r|\n/.test(node.raw);
221992
+ if (isMultiLine) {
221993
+ const startMatch = /\S/.exec(node.raw);
221994
+ if (!startMatch) {
221995
+ return;
221996
+ }
221997
+ startIndex = startMatch.index + node.start;
221998
+ const endMatch = /\S\s*$/.exec(node.raw);
221999
+ endIndex = endMatch.index + 1 + node.start;
222000
+ } else {
222001
+ startIndex = node.start;
222002
+ endIndex = node.end;
222003
+ }
222004
+ } else {
222005
+ startIndex = node.start;
222006
+ endIndex = node.end;
222007
+ }
221964
222008
  const absoluteStart = createAbsolutePositionFromStateVector(
221965
222009
  doc,
221966
222010
  text,
@@ -222266,6 +222310,8 @@ function parseDirectives(code) {
222266
222310
  directives.isAsync = true;
222267
222311
  } else if (part === "module") {
222268
222312
  directives.isModule = true;
222313
+ } else if (part === "jsx-preserve-whitespace") {
222314
+ directives.jsxPreserveWhitespace = true;
222269
222315
  }
222270
222316
  }
222271
222317
  return directives;
@@ -222285,6 +222331,9 @@ function addDirectives(code, directives) {
222285
222331
  if (directives.isModule) {
222286
222332
  directiveString += "module ";
222287
222333
  }
222334
+ if (directives.jsxPreserveWhitespace) {
222335
+ directiveString += "jsx-preserve-whitespace ";
222336
+ }
222288
222337
  directiveString = directiveString.trim() + '";';
222289
222338
  return directiveString + code;
222290
222339
  }
@@ -232812,7 +232861,7 @@ var config2 = new Conf({
232812
232861
  projectName: "casualos-cli"
232813
232862
  });
232814
232863
  var program2 = new Command();
232815
- program2.name("casualos").description("A CLI for CasualOS").version("v4.2.3").option(
232864
+ program2.name("casualos").description("A CLI for CasualOS").version("v4.2.4-alpha.25219073312").option(
232816
232865
  "-e, --endpoint <url>",
232817
232866
  "The endpoint to use for queries. Can be used to override the current endpoint."
232818
232867
  ).option(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "casualos",
3
- "version": "4.2.3",
3
+ "version": "4.2.4-alpha.25219073312",
4
4
  "description": "Command line interface for CasualOS.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@casual-simulation/aux-common": "^4.2.3",
32
- "@casual-simulation/aux-records": "^4.2.3",
33
- "@casual-simulation/aux-runtime": "^4.2.3",
34
- "@casual-simulation/aux-vm": "^4.2.3",
31
+ "@casual-simulation/aux-common": "^4.2.4-alpha.25219073312",
32
+ "@casual-simulation/aux-records": "^4.2.4-alpha.25219073312",
33
+ "@casual-simulation/aux-runtime": "^4.2.4-alpha.25219073312",
34
+ "@casual-simulation/aux-vm": "^4.2.4-alpha.25219073312",
35
35
  "@octokit/app": "^15.1.0",
36
36
  "@octokit/auth-oauth-device": "^7.1.1",
37
37
  "@octokit/core": "^6.1.2",