@rasputin-ai/node 0.5.0-alpha.7 → 0.5.0-alpha.8

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.
@@ -9,6 +9,8 @@ export type CaptureWrap = {
9
9
  line: number;
10
10
  column: number;
11
11
  expressionId: number;
12
+ /** Object-literal shorthand must be expanded before its value can be wrapped. */
13
+ shorthandPropertyName?: string;
12
14
  };
13
15
  type NumericBinaryOp = 'add' | 'sub' | 'mul' | 'div' | 'mod';
14
16
  export type GuardWrap = {
@@ -1 +1 @@
1
- {"version":3,"file":"analyze-function.d.ts","sourceRoot":"","sources":["../../src/derivation/analyze-function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EAGb,cAAc,EAGd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAEN,KAAK,gBAAgB,EAErB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,eAAe,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC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AC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,eAAe,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC1B,CAAC;AAojBF,MAAM,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,EAAE,CAAC,uBAAuB,GAAG;QAAE,IAAI,EAAE,EAAE,CAAC,WAAW,CAAA;KAAE,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAClC,YAAY,EAAE,CAAC,UAAU,EACzB,SAAS,oBAAoB,EAAE,KAC7B,gBAAgB,EAmClB,CAAC"}
package/dist/index.js CHANGED
@@ -2385,7 +2385,7 @@ import {
2385
2385
 
2386
2386
  // src/sdk-meta.ts
2387
2387
  var SDK_NAME = "@rasputin-ai/node";
2388
- var SDK_VERSION = "0.5.0-alpha.7";
2388
+ var SDK_VERSION = "0.5.0-alpha.8";
2389
2389
 
2390
2390
  // src/rasputin-init.ts
2391
2391
  var withExecution = (client, execution, installRuntime, manifest) => {
@@ -542,6 +542,12 @@ var analyzeExpression = (ctx, node) => {
542
542
  for (const property of node.properties) {
543
543
  if (ts.isShorthandPropertyAssignment(property)) {
544
544
  const nested = analyzeExpression(ctx, property.name);
545
+ if (nested.captured) {
546
+ const wrap = ctx.captureWraps.find(
547
+ (candidate) => candidate.expressionId === nested.expressionId
548
+ );
549
+ if (wrap) wrap.shorthandPropertyName = property.name.text;
550
+ }
545
551
  properties.push({ key: property.name.text, value: nested.expressionId });
546
552
  continue;
547
553
  }
@@ -873,7 +879,7 @@ var captureWrapEdits = (wraps, capName) => {
873
879
  for (const wrap of wraps) {
874
880
  edits.push({
875
881
  position: wrap.start,
876
- text: `${capName}(${wrap.rootId},`,
882
+ text: `${wrap.shorthandPropertyName ? `${wrap.shorthandPropertyName}:` : ""}${capName}(${wrap.rootId},`,
877
883
  order: order++
878
884
  });
879
885
  edits.push({
@@ -376,6 +376,12 @@ var analyzeExpression = (ctx, node) => {
376
376
  for (const property of node.properties) {
377
377
  if (ts.isShorthandPropertyAssignment(property)) {
378
378
  const nested = analyzeExpression(ctx, property.name);
379
+ if (nested.captured) {
380
+ const wrap = ctx.captureWraps.find(
381
+ (candidate) => candidate.expressionId === nested.expressionId
382
+ );
383
+ if (wrap) wrap.shorthandPropertyName = property.name.text;
384
+ }
379
385
  properties.push({ key: property.name.text, value: nested.expressionId });
380
386
  continue;
381
387
  }
@@ -707,7 +713,7 @@ var captureWrapEdits = (wraps, capName) => {
707
713
  for (const wrap of wraps) {
708
714
  edits.push({
709
715
  position: wrap.start,
710
- text: `${capName}(${wrap.rootId},`,
716
+ text: `${wrap.shorthandPropertyName ? `${wrap.shorthandPropertyName}:` : ""}${capName}(${wrap.rootId},`,
711
717
  order: order++
712
718
  });
713
719
  edits.push({
@@ -431,6 +431,12 @@ var analyzeExpression = (ctx, node) => {
431
431
  for (const property of node.properties) {
432
432
  if (ts.isShorthandPropertyAssignment(property)) {
433
433
  const nested = analyzeExpression(ctx, property.name);
434
+ if (nested.captured) {
435
+ const wrap = ctx.captureWraps.find(
436
+ (candidate) => candidate.expressionId === nested.expressionId
437
+ );
438
+ if (wrap) wrap.shorthandPropertyName = property.name.text;
439
+ }
434
440
  properties.push({ key: property.name.text, value: nested.expressionId });
435
441
  continue;
436
442
  }
@@ -762,7 +768,7 @@ var captureWrapEdits = (wraps, capName) => {
762
768
  for (const wrap of wraps) {
763
769
  edits.push({
764
770
  position: wrap.start,
765
- text: `${capName}(${wrap.rootId},`,
771
+ text: `${wrap.shorthandPropertyName ? `${wrap.shorthandPropertyName}:` : ""}${capName}(${wrap.rootId},`,
766
772
  order: order++
767
773
  });
768
774
  edits.push({
@@ -1,4 +1,4 @@
1
1
  /** Generated by scripts/generate-sdk-meta.ts — do not edit. */
2
2
  export declare const SDK_NAME = "@rasputin-ai/node";
3
- export declare const SDK_VERSION = "0.5.0-alpha.7";
3
+ export declare const SDK_VERSION = "0.5.0-alpha.8";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/node",
3
- "version": "0.5.0-alpha.7",
3
+ "version": "0.5.0-alpha.8",
4
4
  "description": "Official Rasputin AI SDK for Node and Bun.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@jridgewell/trace-mapping": "0.3.31",
47
- "@rasputin-ai/core": "0.5.0-alpha.7",
47
+ "@rasputin-ai/core": "0.5.0-alpha.8",
48
48
  "typescript": "5"
49
49
  },
50
50
  "devDependencies": {