@superbuilders/primer-tives 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ bun add @superbuilders/primer-tives
19
19
 
20
20
  ## Version
21
21
 
22
- The current SDK version is `5.0.2`.
22
+ The current SDK version is `5.0.4`.
23
23
 
24
24
  ## Entrypoints
25
25
 
@@ -899,6 +899,9 @@ Fatal sentinels:
899
899
  | --- | --- |
900
900
  | `ErrBadRequest` | Primer rejected the runtime request as invalid for the SDK contract. |
901
901
  | `ErrCurriculumInstructionalUndeliverable` | The active curriculum instructional has no deliverable frame content. |
902
+ | `ErrNoActiveFrame` | Primer had no open frame for the submitted intent. |
903
+ | `ErrFrameAlreadyAnswered` | The targeted frame was already answered. |
904
+ | `ErrSessionStateConflict` | The learner intent does not match the active frame type. |
902
905
  | `ErrNoRoutableContent` | The catalog has no routable bootstrap content for the learner's scope. |
903
906
  | `ErrInvalidAccessToken` | The learner token was rejected. |
904
907
  | `ErrTokenExpired` | The learner token expired. |
@@ -1326,13 +1329,13 @@ Runtime errors are represented as `ErroredState` or `FatalState`.
1326
1329
  | `ErrServiceUnavailable` | `ErroredState` | yes | Primer is temporarily unavailable. |
1327
1330
  | `ErrRateLimited` | `ErroredState` | yes | Runtime work is temporarily rate limited. |
1328
1331
  | `ErrConflict` | `ErroredState` | yes | The learner intent conflicts with another in-flight or current runtime action. |
1329
- | `ErrNoActiveFrame` | `ResyncableErroredState` | no | Primer has no open frame for the submitted intent; call `resync()` to realign. |
1330
- | `ErrFrameAlreadyAnswered` | `ResyncableErroredState` | no | The targeted frame was already answered; call `resync()` to realign. |
1331
- | `ErrSessionStateConflict` | `ResyncableErroredState` | no | The learner intent does not match the active frame type; call `resync()` to realign. |
1332
1332
  | `ErrJsonParse` | `ErroredState` | yes | Runtime data could not be interpreted as the SDK contract. |
1333
1333
  | `ErrInvalidSubmission` | `ErroredState` | no | Renderer submitted a value that is invalid for the active interaction. |
1334
1334
  | `ErrBadRequest` | `FatalState` | no | Runtime request violates the SDK contract. |
1335
1335
  | `ErrCurriculumInstructionalUndeliverable` | `FatalState` | no | Curriculum routing reached an instructional with no deliverable frame content. |
1336
+ | `ErrNoActiveFrame` | `FatalState` | no | Primer had no open frame for the submitted intent. |
1337
+ | `ErrFrameAlreadyAnswered` | `FatalState` | no | The targeted frame was already answered. |
1338
+ | `ErrSessionStateConflict` | `FatalState` | no | The learner intent does not match the active frame type. |
1336
1339
  | `ErrNoRoutableContent` | `FatalState` | no | Catalog bootstrap has no routable content for the learner scope. |
1337
1340
  | `ErrInvalidAccessToken` | `FatalState` | no | Learner token is invalid. |
1338
1341
  | `ErrTokenExpired` | `FatalState` | no | Learner token expired. |
@@ -1,4 +1,4 @@
1
1
  export type { PrimerOptions, PrimerOptionsWithAccessToken, PrimerOptionsWithManagedAuth } from "./start";
2
2
  export { start } from "./start";
3
- export type { AccessTokenStartState, AssessmentOutcome, AssessmentOutcomeValue, AuthConfigInvalidState, AuthUnavailableState, ChoiceState, CompletedState, ErroredState, ExtendedTextMultipleState, ExtendedTextSingleState, ExtendedTextState, FatalState, FeedbackKind, FeedbackState, InteractionFeedback, InteractionState, ManagedStartState, MatchState, NonRetriableErroredState, NonSerializable, ObservationState, OrderState, PciInteractionState, PciPendingRenderProps, PciRenderProps, PciSubmittedRenderProps, PrimerState, ResyncableErroredState, RetriableErroredState, RuntimeState, SignInFailedState, SignInRequiredState, SubmittedFeedbackState, TextEntryState, TimedOutFeedbackState } from "./types";
3
+ export type { AccessTokenStartState, AssessmentOutcome, AssessmentOutcomeValue, AuthConfigInvalidState, AuthUnavailableState, ChoiceState, CompletedState, ErroredState, ExtendedTextMultipleState, ExtendedTextSingleState, ExtendedTextState, FatalState, FeedbackKind, FeedbackState, InteractionFeedback, InteractionState, ManagedStartState, MatchState, NonRetriableErroredState, NonSerializable, ObservationState, OrderState, PciInteractionState, PciPendingRenderProps, PciRenderProps, PciSubmittedRenderProps, PrimerState, RetriableErroredState, RuntimeState, SignInFailedState, SignInRequiredState, SubmittedFeedbackState, TextEntryState, TimedOutFeedbackState } from "./types";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,aAAa,EACb,4BAA4B,EAC5B,4BAA4B,EAC5B,MAAM,0CAA0C,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,0CAA0C,CAAA;AAEhE,YAAY,EACX,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,MAAM,0CAA0C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,aAAa,EACb,4BAA4B,EAC5B,4BAA4B,EAC5B,MAAM,0CAA0C,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,0CAA0C,CAAA;AAEhE,YAAY,EACX,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,MAAM,0CAA0C,CAAA"}
@@ -7761,19 +7761,13 @@ var FATAL_SENTINELS = [
7761
7761
  ErrTokenExpired,
7762
7762
  ErrForbidden,
7763
7763
  ErrNotFound,
7764
+ ErrNoActiveFrame,
7764
7765
  ErrNoRoutableContent,
7766
+ ErrFrameAlreadyAnswered,
7767
+ ErrSessionStateConflict,
7765
7768
  ErrSdkUpgradeRequired,
7766
7769
  ErrUnsupportedPci
7767
7770
  ];
7768
- var SESSION_SYNC_SENTINELS = [ErrNoActiveFrame, ErrFrameAlreadyAnswered, ErrSessionStateConflict];
7769
- function isSessionSyncError(err) {
7770
- for (const sentinel of SESSION_SYNC_SENTINELS) {
7771
- if (errors11.is(err, sentinel)) {
7772
- return true;
7773
- }
7774
- }
7775
- return false;
7776
- }
7777
7771
  function isFatalError(err) {
7778
7772
  for (const sentinel of FATAL_SENTINELS) {
7779
7773
  if (errors11.is(err, sentinel)) {
@@ -7783,13 +7777,7 @@ function isFatalError(err) {
7783
7777
  return false;
7784
7778
  }
7785
7779
  function isRetriableError(err) {
7786
- if (errors11.is(err, ErrInvalidSubmission)) {
7787
- return false;
7788
- }
7789
- if (isSessionSyncError(err)) {
7790
- return false;
7791
- }
7792
- return true;
7780
+ return !errors11.is(err, ErrInvalidSubmission);
7793
7781
  }
7794
7782
  function makeSession(sc) {
7795
7783
  const logger = sc.logger;
@@ -7835,23 +7823,6 @@ function makeSession(sc) {
7835
7823
  }
7836
7824
  }
7837
7825
  function errored(error, failedPhase, intent) {
7838
- if (isSessionSyncError(error)) {
7839
- let pending2;
7840
- return {
7841
- phase: "errored",
7842
- error,
7843
- retriable: false,
7844
- resync: function resync() {
7845
- if (pending2) {
7846
- return pending2;
7847
- }
7848
- logger.debug({ failedPhase }, "resyncing session from errored state");
7849
- pending2 = execute({ kind: "observation" }, "observation");
7850
- return pending2;
7851
- },
7852
- toJSON: poisonToJSON
7853
- };
7854
- }
7855
7826
  const retriable = isRetriableError(error);
7856
7827
  if (!retriable) {
7857
7828
  return {
@@ -7985,7 +7956,7 @@ function makeSession(sc) {
7985
7956
  import * as errors12 from "@superbuilders/errors";
7986
7957
 
7987
7958
  // src/version.ts
7988
- var SDK_VERSION = "5.0.2";
7959
+ var SDK_VERSION = "5.0.4";
7989
7960
  var NPM_PACKAGE_URL = "https://www.npmjs.com/package/@superbuilders/primer-tives";
7990
7961
 
7991
7962
  // src/client/transport.ts
@@ -8332,4 +8303,4 @@ export {
8332
8303
  start
8333
8304
  };
8334
8305
 
8335
- //# debugId=437ED91D306035DE64756E2164756E21
8306
+ //# debugId=B9AA7CC48F32D77C64756E2164756E21