MCPcopy Create free account
hub / github.com/compozy/agh / newSessionSoulRefreshCommand

Function newSessionSoulRefreshCommand

internal/cli/authored_context.go:699–731  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

697}
698
699func newSessionSoulRefreshCommand(deps commandDeps) *cobra.Command {
700 var (
701 expectedDigest string
702 idempotencyKey string
703 )
704 cmd := &cobra.Command{
705 Use: "refresh <session-id>",
706 Short: "Refresh an idle session's Soul snapshot",
707 Example: " agh session soul refresh sess_123 --expected-digest sha256:old --json",
708 Args: exactOneNonBlankArg(),
709 RunE: func(cmd *cobra.Command, args []string) error {
710 client, err := clientFromDeps(deps)
711 if err != nil {
712 return err
713 }
714 digest, err := changedStringFlag(cmd, "expected-digest", expectedDigest)
715 if err != nil {
716 return err
717 }
718 record, err := client.RefreshSessionSoul(cmd.Context(), args[0], SessionSoulRefreshRequest{
719 ExpectedDigest: digest,
720 IdempotencyKey: strings.TrimSpace(idempotencyKey),
721 })
722 if err != nil {
723 return err
724 }
725 return writeCommandOutput(cmd, agentSoulBundle(record))
726 },
727 }
728 cmd.Flags().StringVar(&expectedDigest, "expected-digest", "", "Expected current session Soul digest for CAS")
729 cmd.Flags().StringVar(&idempotencyKey, "idempotency-key", "", "Optional idempotency key")
730 return cmd
731}
732
733func newSessionHealthCommand(deps commandDeps) *cobra.Command {
734 cmd := &cobra.Command{

Callers 1

newSessionSoulCommandFunction · 0.85

Calls 6

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
changedStringFlagFunction · 0.85
writeCommandOutputFunction · 0.85
agentSoulBundleFunction · 0.85
RefreshSessionSoulMethod · 0.65

Tested by

no test coverage detected