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

Method nativeBoundSession

internal/daemon/native_tools.go:4786–4813  ·  view source on GitHub ↗
(
	ctx context.Context,
	scope toolspkg.Scope,
)

Source from the content-addressed store, hash-verified

4784}
4785
4786func (n *daemonNativeTools) nativeBoundSession(
4787 ctx context.Context,
4788 scope toolspkg.Scope,
4789) (*nativeBoundSessionScope, error) {
4790 sessionID := strings.TrimSpace(scope.SessionID)
4791 if sessionID == "" {
4792 return nil, nil
4793 }
4794 if n == nil || n.deps == nil || n.deps.Sessions == nil {
4795 return nil, errors.New("daemon: sessions are required")
4796 }
4797 info, err := n.deps.Sessions.Status(ctx, sessionID)
4798 if err != nil {
4799 return nil, err
4800 }
4801 bound := &nativeBoundSessionScope{
4802 sessionID: strings.TrimSpace(info.ID),
4803 workspaceID: strings.TrimSpace(info.WorkspaceID),
4804 networkChannels: make(map[string]struct{}),
4805 }
4806 lineage := store.NormalizeSessionLineage(info.ID, info.Lineage)
4807 if lineage != nil {
4808 for _, channel := range lineage.PermissionPolicy.NetworkChannels {
4809 bound.networkChannels[channel] = struct{}{}
4810 }
4811 }
4812 return bound, nil
4813}
4814
4815func nativeBoundWorkspaceRef(bound *nativeBoundSessionScope, workspaceRef string) string {
4816 if bound == nil {

Callers 4

networkChannelsMethod · 0.95
networkInboxMethod · 0.95
networkSendMethod · 0.95
sessionDescribeMethod · 0.95

Calls 2

NormalizeSessionLineageFunction · 0.92
StatusMethod · 0.65

Tested by

no test coverage detected